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