[{"data":1,"prerenderedAt":298,"buildId":299},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fprimitives\u002Fmath\u002Fdpdxfine":3,"github-stars":206,"guide-nav":208},{"id":4,"title":5,"body":6,"categoryId":47,"categorySlug":47,"categoryTitle":191,"curated":192,"description":193,"editUrl":194,"extension":195,"group":196,"groupTitle":197,"kind":198,"meta":199,"navigation":200,"path":201,"seo":202,"sourceUrl":203,"stem":204,"wordCount":194,"__hash__":205},"primitives\u002Fdocs\u002Fprimitives\u002F22.math\u002F49.dpdxfine.md","dpdxFine",{"type":7,"value":8,"toc":184},"minimark",[9,13,21,42,57,60,65,102,106,130,134,170,174,180],[10,11,5],"h1",{"id":12},"dpdxfine",[14,15,16,20],"p",{},[17,18,19],"code",{},"dpdx"," measured per pixel rather than per 2×2 pixel block.",[22,23,28],"pre",{"className":24,"code":25,"language":26,"meta":27,"style":27},"language-ts shiki shiki-themes github-dark","dpdxFine(x: Val): Expr\n","ts","",[17,29,30],{"__ignoreMap":27},[31,32,35,38],"span",{"class":33,"line":34},"line",1,[31,36,5],{"class":37},"svObZ",[31,39,41],{"class":40},"s95oV","(x: Val): Expr\n",[14,43,44,45,48,49,52,53,56],{},"Import ",[17,46,47],{},"math"," from ",[17,50,51],{},"shaders\u002Fstd"," and use ",[17,54,55],{},"math.dpdxFine",".",[14,58,59],{},"Plain derivatives may be shared by each 2×2 block of pixels, so anything scaled by them can step in a 2-pixel grid. Use the fine forms when a derivative drives a visible quantity.",[61,62,64],"h2",{"id":63},"parameters","Parameters",[66,67,68,84],"table",{},[69,70,71],"thead",{},[72,73,74,78,81],"tr",{},[75,76,77],"th",{},"Name",[75,79,80],{},"Type",[75,82,83],{},"Notes",[85,86,87],"tbody",{},[72,88,89,95,100],{},[90,91,92],"td",{},[17,93,94],{},"x",[90,96,97],{},[17,98,99],{},"Val",[90,101],{},[61,103,105],{"id":104},"example","Example",[22,107,109],{"className":24,"code":108,"language":26,"meta":27,"style":27},"const stepX = dpdxFine(lookupUV)\n",[17,110,111],{"__ignoreMap":27},[31,112,113,117,121,124,127],{"class":33,"line":34},[31,114,116],{"class":115},"snl16","const",[31,118,120],{"class":119},"sDLfK"," stepX",[31,122,123],{"class":115}," =",[31,125,126],{"class":37}," dpdxFine",[31,128,129],{"class":40},"(lookupUV)\n",[61,131,133],{"id":132},"see-also","See also",[135,136,137,147,159],"ul",{},[138,139,140,146],"li",{},[141,142,144],"a",{"href":143},"\u002Fdocs\u002Fprimitives\u002Fmath\u002Fdpdx",[17,145,19],{}," — How much a value changes from this pixel to the next one to the right.",[138,148,149,155,156,20],{},[141,150,152],{"href":151},"\u002Fdocs\u002Fprimitives\u002Fmath\u002Fdpdyfine",[17,153,154],{},"dpdyFine"," — ",[17,157,158],{},"dpdy",[138,160,161,155,167,20],{},[141,162,164],{"href":163},"\u002Fdocs\u002Fprimitives\u002Fmath\u002Ffwidthfine",[17,165,166],{},"fwidthFine",[17,168,169],{},"fwidth",[61,171,173],{"id":172},"used-by","Used by",[14,175,176],{},[141,177,179],{"href":178},"\u002Fdocs\u002Fcomponents\u002Fprismaticglass","PrismaticGlass",[181,182,183],"style",{},"html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}",{"title":27,"searchDepth":185,"depth":185,"links":186},2,[187,188,189,190],{"id":63,"depth":185,"text":64},{"id":104,"depth":185,"text":105},{"id":132,"depth":185,"text":133},{"id":172,"depth":185,"text":173},"Math",false,"`dpdx` measured per pixel rather than per 2×2 pixel block.",null,"md","space","Shapes, frames & warps","function",{},true,"\u002Fdocs\u002Fprimitives\u002Fmath\u002Fdpdxfine",{"title":5,"description":193},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Fmath.ts#L469","docs\u002Fprimitives\u002F22.math\u002F49.dpdxfine","5ITorWVEjMtdbuidwiuAUsIBaefagU-rUzr6FYp8SKw",{"stars":207},6080,[209,213,217,221,225,229,233,237,241,245,249,253,257,261,265,269,273,278,282,286,290,294],{"path":210,"title":211,"description":212,"category":17},"\u002Fdocs\u002Fguide","Getting started","Shaders is a desktop app where your AI agent designs interactive effects on an infinite canvas, and you shape them by hand.",{"path":214,"title":215,"description":216,"category":17},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",{"path":218,"title":219,"description":220,"category":17},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":222,"title":223,"description":224,"category":17},"\u002Fdocs\u002Fguide\u002Fblending-masking","Blending and masking","Control how a layer mixes with the layers below it, and reveal one layer through another.",{"path":226,"title":227,"description":228,"category":17},"\u002Fdocs\u002Fguide\u002Fprops-reactivity","Props and reactivity","Bind props to your framework's state so effects update when it changes, and animate props with an animation library.",{"path":230,"title":231,"description":232,"category":17},"\u002Fdocs\u002Fguide\u002Fanimation","Animating a shader","Tween a shader's props with Motion, GSAP or anything else that animates a number.",{"path":234,"title":235,"description":236,"category":17},"\u002Fdocs\u002Fguide\u002Fdynamic-props","Dynamic props","Drive any numeric or position prop from time, the cursor, or another layer, without writing animation code.",{"path":238,"title":239,"description":240,"category":17},"\u002Fdocs\u002Fguide\u002Flayout-positioning","Layout and positioning","Size and place a shader in your page with CSS, as a background, a fill, or an inline block.",{"path":242,"title":243,"description":244,"category":17},"\u002Fdocs\u002Fguide\u002Fsizing-and-units","Sizing and units","Size and place layers in CSS units (px, %, vw, rem, and canvas units) that stay correct as the canvas and window resize.",{"path":246,"title":247,"description":248,"category":17},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in any CSS unit.",{"path":250,"title":251,"description":252,"category":17},"\u002Fdocs\u002Fguide\u002Fshape-effects","Shape effects","Pick the 2D, 3D or custom SVG shape that Glass, Neon, Emboss and other shape effects draw inside.",{"path":254,"title":255,"description":256,"category":17},"\u002Fdocs\u002Fguide\u002Fcolor-space","Color space","Match colors to your design tool with the output color space, and keep bright layers from clipping with tone mapping.",{"path":258,"title":259,"description":260,"category":17},"\u002Fdocs\u002Fguide\u002Fhooks-events","Hooks and events","Run code when an effect is ready to show, and show a fallback when the GPU can't run it.",{"path":262,"title":263,"description":264,"category":17},"\u002Fdocs\u002Fguide\u002Fperformance","Performance","Learn what makes an effect expensive on the GPU and how to keep it inside the frame budget.",{"path":266,"title":267,"description":268,"category":17},"\u002Fdocs\u002Fguide\u002Fcustom-shaders","Custom components","Write your own component in TypeScript, use it like any component in the library, and write WGSL by hand when you need to.",{"path":270,"title":271,"description":272,"category":17},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":274,"title":275,"description":276,"category":277},"\u002Fdocs\u002Fguide\u002Fmcp","Working with your agent","The Shaders MCP connects your AI agent to the desktop app, so it can design shaders on your canvas and install them in your project.","workflows",{"path":279,"title":280,"description":281,"category":277},"\u002Fdocs\u002Fguide\u002Fcli","Working with the CLI","The Shaders CLI installs shaders from your projects and the Pro library into your codebase as component files, and keeps them in sync as you keep designing.",{"path":283,"title":284,"description":285,"category":277},"\u002Fdocs\u002Fguide\u002Fframeworks","Supported frameworks","Shaders runs in any web project that renders in a browser with WebGPU, with components for React, Vue, Svelte and Solid and a JavaScript API for everything else.",{"path":287,"title":288,"description":289,"category":17},"\u002Fdocs\u002Fguide\u002Fagent-skill","Agent skill for the engine","Teach your coding agent to write Shaders code with the open-source engine, for when it's working in your codebase instead of on the canvas.",{"path":291,"title":292,"description":293,"category":17},"\u002Fdocs\u002Fguide\u002Fvideo-rendering","Rendering to video","Render a shader effect to video frame by frame, from Remotion, Hyperframes or your own headless Chrome script.",{"path":295,"title":296,"description":297,"category":17},"\u002Fdocs\u002Fguide\u002Fssr","Server rendering","Render Shaders in Next.js, Nuxt, SvelteKit, SolidStart and other SSR apps by keeping each shader on the client.",1796051181812,"06e02370-81a6-4d74-9931-661d71414be1"]