[{"data":1,"prerenderedAt":376,"buildId":377},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fprimitives\u002Fsim-grids\u002Fstage-values":3,"github-stars":284,"guide-nav":286},{"id":4,"title":5,"body":6,"categoryId":268,"categorySlug":269,"categoryTitle":270,"curated":271,"description":16,"editUrl":272,"extension":273,"group":274,"groupTitle":275,"kind":276,"meta":277,"navigation":278,"path":279,"seo":280,"sourceUrl":281,"stem":282,"wordCount":272,"__hash__":283},"primitives\u002Fdocs\u002Fprimitives\u002F48.sim-grids\u002F3.stage-values.md","stage.values",{"type":7,"value":8,"toc":261},"minimark",[9,13,17,66,81,86,137,141,195,212,216,243,247,257],[10,11,5],"h1",{"id":12},"stagevalues",[14,15,16],"p",{},"A named step that writes this frame's values for the passes after it.",[18,19,24],"pre",{"className":20,"code":21,"language":22,"meta":23,"style":23},"language-ts shiki shiki-themes github-dark","stage.values(name: string, run: (f: GridFrame) => void): GridStage\n","ts","",[25,26,27],"code",{"__ignoreMap":23},[28,29,32,36,40,43,47,51,54,57,60,63],"span",{"class":30,"line":31},"line",1,[28,33,35],{"class":34},"s95oV","stage.",[28,37,39],{"class":38},"svObZ","values",[28,41,42],{"class":34},"(name: string, run: (",[28,44,46],{"class":45},"s9osk","f",[28,48,50],{"class":49},"snl16",":",[28,52,53],{"class":38}," GridFrame",[28,55,56],{"class":34},") ",[28,58,59],{"class":49},"=>",[28,61,62],{"class":49}," void",[28,64,65],{"class":34},"): GridStage\n",[14,67,68,69,72,73,76,77,80],{},"Import ",[25,70,71],{},"sim"," from ",[25,74,75],{},"shaders\u002Fstd"," and use ",[25,78,79],{},"sim.grids.stage.values",".",[82,83,85],"h2",{"id":84},"parameters","Parameters",[87,88,89,105],"table",{},[90,91,92],"thead",{},[93,94,95,99,102],"tr",{},[96,97,98],"th",{},"Name",[96,100,101],{},"Type",[96,103,104],{},"Notes",[106,107,108,123],"tbody",{},[93,109,110,116,121],{},[111,112,113],"td",{},[25,114,115],{},"name",[111,117,118],{},[25,119,120],{},"string",[111,122],{},[93,124,125,130,135],{},[111,126,127],{},[25,128,129],{},"run",[111,131,132],{},[25,133,134],{},"(f: GridFrame) => void",[111,136],{},[82,138,140],{"id":139},"example","Example",[18,142,144],{"className":20,"code":143,"language":22,"meta":23,"style":23},"stage.values('write', (f) => paramsU.write({dt: f.dt, radius: f.num('radius', 0.4)}))\n",[25,145,146],{"__ignoreMap":23},[28,147,148,150,152,155,159,162,164,166,168,171,174,177,180,182,185,188,192],{"class":30,"line":31},[28,149,35],{"class":34},[28,151,39],{"class":38},[28,153,154],{"class":34},"(",[28,156,158],{"class":157},"sU2Wk","'write'",[28,160,161],{"class":34},", (",[28,163,46],{"class":45},[28,165,56],{"class":34},[28,167,59],{"class":49},[28,169,170],{"class":34}," paramsU.",[28,172,173],{"class":38},"write",[28,175,176],{"class":34},"({dt: f.dt, radius: f.",[28,178,179],{"class":38},"num",[28,181,154],{"class":34},[28,183,184],{"class":157},"'radius'",[28,186,187],{"class":34},", ",[28,189,191],{"class":190},"sDLfK","0.4",[28,193,194],{"class":34},")}))\n",[196,197,198],"blockquote",{},[14,199,200,204,205,208,209,80],{},[201,202,203],"strong",{},"Tip."," Read props here with ",[25,206,207],{},"f.num('prop', fallback)"," so a prop that is briefly not a number cannot reach the GPU as ",[25,210,211],{},"undefined",[82,213,215],{"id":214},"see-also","See also",[217,218,219,234],"ul",{},[220,221,222,229,230,233],"li",{},[223,224,226],"a",{"href":225},"\u002Fdocs\u002Fprimitives\u002Fsim-grids\u002Fstage-host",[25,227,228],{},"stage.host"," — A named step that runs before any gate: pointer smoothing, activity flags, anything a later ",[25,231,232],{},"settle"," needs to know.",[220,235,236,242],{},[223,237,239],{"href":238},"\u002Fdocs\u002Fprimitives\u002Fsim-grids\u002Fstage-pass",[25,240,241],{},"stage.pass"," — One GPU pass, the same every frame.",[82,244,246],{"id":245},"used-by","Used by",[14,248,249,187,253],{},[223,250,252],{"href":251},"\u002Fdocs\u002Fcomponents\u002Fpixelsort","PixelSort",[223,254,256],{"href":255},"\u002Fdocs\u002Fcomponents\u002Freactiondiffusion","ReactionDiffusion",[258,259,260],"style",{},"html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .s9osk, html code.shiki .s9osk{--shiki-default:#FFAB70}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}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 .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}",{"title":23,"searchDepth":262,"depth":262,"links":263},2,[264,265,266,267],{"id":84,"depth":262,"text":85},{"id":139,"depth":262,"text":140},{"id":214,"depth":262,"text":215},{"id":245,"depth":262,"text":246},"sim.grids","sim-grids","Grid programs",false,null,"md","simulation","Simulation","function",{},true,"\u002Fdocs\u002Fprimitives\u002Fsim-grids\u002Fstage-values",{"title":5,"description":16},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Fsim\u002Fgrids.ts#L213","docs\u002Fprimitives\u002F48.sim-grids\u002F3.stage-values","1jOZIr1QWSR6HGBJr5fuf4Rgdynh1-5jdfgqP8HhR3c",{"stars":285},6080,[287,291,295,299,303,307,311,315,319,323,327,331,335,339,343,347,351,356,360,364,368,372],{"path":288,"title":289,"description":290,"category":25},"\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":292,"title":293,"description":294,"category":25},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",{"path":296,"title":297,"description":298,"category":25},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":300,"title":301,"description":302,"category":25},"\u002Fdocs\u002Fguide\u002Fblending-masking","Blending and masking","Control how a layer mixes with the layers below it, and reveal one layer through another.",{"path":304,"title":305,"description":306,"category":25},"\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":308,"title":309,"description":310,"category":25},"\u002Fdocs\u002Fguide\u002Fanimation","Animating a shader","Tween a shader's props with Motion, GSAP or anything else that animates a number.",{"path":312,"title":313,"description":314,"category":25},"\u002Fdocs\u002Fguide\u002Fdynamic-props","Dynamic props","Drive any numeric or position prop from time, the cursor, or another layer, without writing animation code.",{"path":316,"title":317,"description":318,"category":25},"\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":320,"title":321,"description":322,"category":25},"\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":324,"title":325,"description":326,"category":25},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in any CSS unit.",{"path":328,"title":329,"description":330,"category":25},"\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":332,"title":333,"description":334,"category":25},"\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":336,"title":337,"description":338,"category":25},"\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":340,"title":341,"description":342,"category":25},"\u002Fdocs\u002Fguide\u002Fperformance","Performance","Learn what makes an effect expensive on the GPU and how to keep it inside the frame budget.",{"path":344,"title":345,"description":346,"category":25},"\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":348,"title":349,"description":350,"category":25},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":352,"title":353,"description":354,"category":355},"\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":357,"title":358,"description":359,"category":355},"\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":361,"title":362,"description":363,"category":355},"\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":365,"title":366,"description":367,"category":25},"\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":369,"title":370,"description":371,"category":25},"\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":373,"title":374,"description":375,"category":25},"\u002Fdocs\u002Fguide\u002Fssr","Server rendering","Render Shaders in Next.js, Nuxt, SvelteKit, SolidStart and other SSR apps by keeping each shader on the client.",1796051187273,"06e02370-81a6-4d74-9931-661d71414be1"]