[{"data":1,"prerenderedAt":269,"buildId":270},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fprimitives\u002Fmath\u002Fdpdy":3,"github-stars":177,"guide-nav":179},{"id":4,"title":5,"body":6,"categoryId":43,"categorySlug":43,"categoryTitle":163,"curated":164,"description":15,"editUrl":165,"extension":166,"group":167,"groupTitle":168,"kind":169,"meta":170,"navigation":171,"path":172,"seo":173,"sourceUrl":174,"stem":175,"wordCount":165,"__hash__":176},"primitives\u002Fdocs\u002Fprimitives\u002F22.math\u002F50.dpdy.md","dpdy",{"type":7,"value":8,"toc":157},"minimark",[9,12,16,38,53,58,95,99,123,127,153],[10,11,5],"h1",{"id":5},[13,14,15],"p",{},"How much a value changes from this pixel to the next one down.",[17,18,23],"pre",{"className":19,"code":20,"language":21,"meta":22,"style":22},"language-ts shiki shiki-themes github-dark","dpdy(x: Val): Expr\n","ts","",[24,25,26],"code",{"__ignoreMap":22},[27,28,31,34],"span",{"class":29,"line":30},"line",1,[27,32,5],{"class":33},"svObZ",[27,35,37],{"class":36},"s95oV","(x: Val): Expr\n",[13,39,40,41,44,45,48,49,52],{},"Import ",[24,42,43],{},"math"," from ",[24,46,47],{},"shaders\u002Fstd"," and use ",[24,50,51],{},"math.dpdy",".",[54,55,57],"h2",{"id":56},"parameters","Parameters",[59,60,61,77],"table",{},[62,63,64],"thead",{},[65,66,67,71,74],"tr",{},[68,69,70],"th",{},"Name",[68,72,73],{},"Type",[68,75,76],{},"Notes",[78,79,80],"tbody",{},[65,81,82,88,93],{},[83,84,85],"td",{},[24,86,87],{},"x",[83,89,90],{},[24,91,92],{},"Val",[83,94],{},[54,96,98],{"id":97},"example","Example",[17,100,102],{"className":19,"code":101,"language":21,"meta":22,"style":22},"const stepY = dpdy(lookupUV)\n",[24,103,104],{"__ignoreMap":22},[27,105,106,110,114,117,120],{"class":29,"line":30},[27,107,109],{"class":108},"snl16","const",[27,111,113],{"class":112},"sDLfK"," stepY",[27,115,116],{"class":108}," =",[27,118,119],{"class":33}," dpdy",[27,121,122],{"class":36},"(lookupUV)\n",[54,124,126],{"id":125},"see-also","See also",[128,129,130,141],"ul",{},[131,132,133,140],"li",{},[134,135,137],"a",{"href":136},"\u002Fdocs\u002Fprimitives\u002Fmath\u002Fdpdx",[24,138,139],{},"dpdx"," — How much a value changes from this pixel to the next one to the right.",[131,142,143,149,150,52],{},[134,144,146],{"href":145},"\u002Fdocs\u002Fprimitives\u002Fmath\u002Ffwidth",[24,147,148],{},"fwidth"," — How much a value changes across one pixel, in any direction: ",[24,151,152],{},"|dpdx| + |dpdy|",[154,155,156],"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":22,"searchDepth":158,"depth":158,"links":159},2,[160,161,162],{"id":56,"depth":158,"text":57},{"id":97,"depth":158,"text":98},{"id":125,"depth":158,"text":126},"Math",false,null,"md","space","Shapes, frames & warps","function",{},true,"\u002Fdocs\u002Fprimitives\u002Fmath\u002Fdpdy",{"title":5,"description":15},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Fmath.ts#L441","docs\u002Fprimitives\u002F22.math\u002F50.dpdy","Y9Kh2WZP2Vj10oaNb5WptmZ9CeHSr8pM2ArIDcv0S7U",{"stars":178},6080,[180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,249,253,257,261,265],{"path":181,"title":182,"description":183,"category":24},"\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":185,"title":186,"description":187,"category":24},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",{"path":189,"title":190,"description":191,"category":24},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":193,"title":194,"description":195,"category":24},"\u002Fdocs\u002Fguide\u002Fblending-masking","Blending and masking","Control how a layer mixes with the layers below it, and reveal one layer through another.",{"path":197,"title":198,"description":199,"category":24},"\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":201,"title":202,"description":203,"category":24},"\u002Fdocs\u002Fguide\u002Fanimation","Animating a shader","Tween a shader's props with Motion, GSAP or anything else that animates a number.",{"path":205,"title":206,"description":207,"category":24},"\u002Fdocs\u002Fguide\u002Fdynamic-props","Dynamic props","Drive any numeric or position prop from time, the cursor, or another layer, without writing animation code.",{"path":209,"title":210,"description":211,"category":24},"\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":213,"title":214,"description":215,"category":24},"\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":217,"title":218,"description":219,"category":24},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in any CSS unit.",{"path":221,"title":222,"description":223,"category":24},"\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":225,"title":226,"description":227,"category":24},"\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":229,"title":230,"description":231,"category":24},"\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":233,"title":234,"description":235,"category":24},"\u002Fdocs\u002Fguide\u002Fperformance","Performance","Learn what makes an effect expensive on the GPU and how to keep it inside the frame budget.",{"path":237,"title":238,"description":239,"category":24},"\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":241,"title":242,"description":243,"category":24},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":245,"title":246,"description":247,"category":248},"\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":250,"title":251,"description":252,"category":248},"\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":254,"title":255,"description":256,"category":248},"\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":258,"title":259,"description":260,"category":24},"\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":262,"title":263,"description":264,"category":24},"\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":266,"title":267,"description":268,"category":24},"\u002Fdocs\u002Fguide\u002Fssr","Server rendering","Render Shaders in Next.js, Nuxt, SvelteKit, SolidStart and other SSR apps by keeping each shader on the client.",1796051181824,"06e02370-81a6-4d74-9931-661d71414be1"]