[{"data":1,"prerenderedAt":205,"buildId":206},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fprimitives\u002Fop\u002Fgradient":3,"github-stars":113,"guide-nav":115},{"id":4,"title":5,"body":6,"categoryId":51,"categorySlug":51,"categoryTitle":98,"curated":99,"description":100,"editUrl":101,"extension":102,"group":103,"groupTitle":104,"kind":105,"meta":106,"navigation":107,"path":108,"seo":109,"sourceUrl":110,"stem":111,"wordCount":101,"__hash__":112},"primitives\u002Fdocs\u002Fprimitives\u002F47.op\u002F3.gradient.md","gradient",{"type":7,"value":8,"toc":94},"minimark",[9,12,25,46,61,66,90],[10,11,5],"h1",{"id":5},[13,14,15,16,20,21,24],"p",{},"A derived output: the slope of ",[17,18,19],"code",{},".x"," at every cell as ",[17,22,23],{},".xy",", ready for a displacement.",[26,27,32],"pre",{"className":28,"code":29,"language":30,"meta":31,"style":31},"language-ts shiki shiki-themes github-dark","gradient(): GradientOp\n","ts","",[17,33,34],{"__ignoreMap":31},[35,36,39,42],"span",{"class":37,"line":38},"line",1,[35,40,5],{"class":41},"svObZ",[35,43,45],{"class":44},"s95oV","(): GradientOp\n",[13,47,48,49,52,53,56,57,60],{},"Import ",[17,50,51],{},"op"," from ",[17,54,55],{},"shaders\u002Fstd"," and use ",[17,58,59],{},"op.gradient",".",[62,63,65],"h2",{"id":64},"example","Example",[26,67,69],{"className":28,"code":68,"language":30,"meta":31,"style":31},"derive: {slope: op.gradient()}\n",[17,70,71],{"__ignoreMap":31},[35,72,73,76,79,82,85,87],{"class":37,"line":38},[35,74,75],{"class":41},"derive",[35,77,78],{"class":44},": {",[35,80,81],{"class":41},"slope",[35,83,84],{"class":44},": op.",[35,86,5],{"class":41},[35,88,89],{"class":44},"()}\n",[91,92,93],"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);}",{"title":31,"searchDepth":95,"depth":95,"links":96},2,[97],{"id":64,"depth":95,"text":65},"Grid steps",false,"A derived output: the slope of `.x` at every cell as `.xy`, ready for a displacement.",null,"md","simulation","Simulation","function",{},true,"\u002Fdocs\u002Fprimitives\u002Fop\u002Fgradient",{"title":5,"description":100},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Fops.ts#L120","docs\u002Fprimitives\u002F47.op\u002F3.gradient","V-wYJPaV6FZEjR7axPR_jkc4VW3xlQ2Lr4BUlS5He08",{"stars":114},6080,[116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,185,189,193,197,201],{"path":117,"title":118,"description":119,"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":121,"title":122,"description":123,"category":17},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",{"path":125,"title":126,"description":127,"category":17},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":129,"title":130,"description":131,"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":133,"title":134,"description":135,"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":137,"title":138,"description":139,"category":17},"\u002Fdocs\u002Fguide\u002Fanimation","Animating a shader","Tween a shader's props with Motion, GSAP or anything else that animates a number.",{"path":141,"title":142,"description":143,"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":145,"title":146,"description":147,"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":149,"title":150,"description":151,"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":153,"title":154,"description":155,"category":17},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in any CSS unit.",{"path":157,"title":158,"description":159,"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":161,"title":162,"description":163,"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":165,"title":166,"description":167,"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":169,"title":170,"description":171,"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":173,"title":174,"description":175,"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":177,"title":178,"description":179,"category":17},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":181,"title":182,"description":183,"category":184},"\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":186,"title":187,"description":188,"category":184},"\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":190,"title":191,"description":192,"category":184},"\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":194,"title":195,"description":196,"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":198,"title":199,"description":200,"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":202,"title":203,"description":204,"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.",1796051186220,"06e02370-81a6-4d74-9931-661d71414be1"]