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