[{"data":1,"prerenderedAt":289,"buildId":290},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fprimitives\u002Fsim-grids\u002Fstage-readywhen":3,"github-stars":197,"guide-nav":199},{"id":4,"title":5,"body":6,"categoryId":180,"categorySlug":181,"categoryTitle":182,"curated":183,"description":184,"editUrl":185,"extension":186,"group":187,"groupTitle":188,"kind":189,"meta":190,"navigation":191,"path":192,"seo":193,"sourceUrl":194,"stem":195,"wordCount":185,"__hash__":196},"primitives\u002Fdocs\u002Fprimitives\u002F48.sim-grids\u002F10.stage-readywhen.md","stage.readyWhen",{"type":7,"value":8,"toc":173},"minimark",[9,13,26,58,72,77,113,117,136,140,154,158,169],[10,11,5],"h1",{"id":12},"stagereadywhen",[14,15,16,17,21,22,25],"p",{},"Run nothing until ",[18,19,20],"code",{},"fn"," returns true, typically once the child's picture has arrived through ",[18,23,24],{},"bindInputs",".",[27,28,33],"pre",{"className":29,"code":30,"language":31,"meta":32,"style":32},"language-ts shiki shiki-themes github-dark","stage.readyWhen(fn: () => boolean): GridStage\n","ts","",[18,34,35],{"__ignoreMap":32},[36,37,40,44,48,51,55],"span",{"class":38,"line":39},"line",1,[36,41,43],{"class":42},"s95oV","stage.",[36,45,47],{"class":46},"svObZ","readyWhen",[36,49,50],{"class":42},"(fn: () ",[36,52,54],{"class":53},"snl16","=>",[36,56,57],{"class":42}," boolean): GridStage\n",[14,59,60,61,64,65,68,69,25],{},"Import ",[18,62,63],{},"sim"," from ",[18,66,67],{},"shaders\u002Fstd"," and use ",[18,70,71],{},"sim.grids.stage.readyWhen",[73,74,76],"h2",{"id":75},"parameters","Parameters",[78,79,80,96],"table",{},[81,82,83],"thead",{},[84,85,86,90,93],"tr",{},[87,88,89],"th",{},"Name",[87,91,92],{},"Type",[87,94,95],{},"Notes",[97,98,99],"tbody",{},[84,100,101,106,111],{},[102,103,104],"td",{},[18,105,20],{},[102,107,108],{},[18,109,110],{},"() => boolean",[102,112],{},[73,114,116],{"id":115},"example","Example",[27,118,120],{"className":29,"code":119,"language":31,"meta":32,"style":32},"stage.readyWhen(() => lumaReady)\n",[18,121,122],{"__ignoreMap":32},[36,123,124,126,128,131,133],{"class":38,"line":39},[36,125,43],{"class":42},[36,127,47],{"class":46},[36,129,130],{"class":42},"(() ",[36,132,54],{"class":53},[36,134,135],{"class":42}," lumaReady)\n",[73,137,139],{"id":138},"see-also","See also",[141,142,143],"ul",{},[144,145,146,153],"li",{},[147,148,150],"a",{"href":149},"\u002Fdocs\u002Fprimitives\u002Fsim-grids\u002Fstage-cache",[18,151,152],{},"stage.cache"," — A GPU pass chosen per frame, for a pass whose input is rebound after the frame starts.",[73,155,157],{"id":156},"used-by","Used by",[14,159,160,164,165],{},[147,161,163],{"href":162},"\u002Fdocs\u002Fcomponents\u002Fpixelsort","PixelSort",", ",[147,166,168],{"href":167},"\u002Fdocs\u002Fcomponents\u002Freactiondiffusion","ReactionDiffusion",[170,171,172],"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 .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);}",{"title":32,"searchDepth":174,"depth":174,"links":175},2,[176,177,178,179],{"id":75,"depth":174,"text":76},{"id":115,"depth":174,"text":116},{"id":138,"depth":174,"text":139},{"id":156,"depth":174,"text":157},"sim.grids","sim-grids","Grid programs",false,"Run nothing until `fn` returns true, typically once the child's picture has arrived through `bindInputs`.",null,"md","simulation","Simulation","function",{},true,"\u002Fdocs\u002Fprimitives\u002Fsim-grids\u002Fstage-readywhen",{"title":5,"description":184},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Fsim\u002Fgrids.ts#L261","docs\u002Fprimitives\u002F48.sim-grids\u002F10.stage-readywhen","IVekiKlZJV0iPDO4POEzCH79YIUwAErtohe9GlsZZ40",{"stars":198},6080,[200,204,208,212,216,220,224,228,232,236,240,244,248,252,256,260,264,269,273,277,281,285],{"path":201,"title":202,"description":203,"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":205,"title":206,"description":207,"category":18},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",{"path":209,"title":210,"description":211,"category":18},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":213,"title":214,"description":215,"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":217,"title":218,"description":219,"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":221,"title":222,"description":223,"category":18},"\u002Fdocs\u002Fguide\u002Fanimation","Animating a shader","Tween a shader's props with Motion, GSAP or anything else that animates a number.",{"path":225,"title":226,"description":227,"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":229,"title":230,"description":231,"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":233,"title":234,"description":235,"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":237,"title":238,"description":239,"category":18},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in any CSS unit.",{"path":241,"title":242,"description":243,"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":245,"title":246,"description":247,"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":249,"title":250,"description":251,"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":253,"title":254,"description":255,"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":257,"title":258,"description":259,"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":261,"title":262,"description":263,"category":18},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":265,"title":266,"description":267,"category":268},"\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":270,"title":271,"description":272,"category":268},"\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":274,"title":275,"description":276,"category":268},"\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":278,"title":279,"description":280,"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":282,"title":283,"description":284,"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":286,"title":287,"description":288,"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.",1796051186986,"06e02370-81a6-4d74-9931-661d71414be1"]