[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"guide-nav":3,"doc-\u002Fdocs\u002Fprimitives\u002Fsim-feedback":145},[4,10,16,20,24,28,32,36,40,44,48,52,56,60,64,69,73,78,82,86,90,94,98,102,106,110,114,117,120,124,127,131,134,138,141],{"path":5,"title":6,"description":7,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide","Getting started","Shaders is a library of GPU effect components for Vue, React, Svelte, Solid, JavaScript and Framer, with a design editor for building with them.","code",null,{"path":11,"title":12,"description":13,"category":8,"exclude":14,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",[15],"js",{"path":17,"title":18,"description":19,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":21,"title":22,"description":23,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fblending-masking","Blending and masking","Control how a layer mixes with the layers below it, and reveal one layer through another.",{"path":25,"title":26,"description":27,"category":8,"exclude":9,"forceFramework":9},"\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":29,"title":30,"description":31,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fdynamic-props","Dynamic props","Drive any numeric or position prop from time, the cursor, or another layer, without writing animation code.",{"path":33,"title":34,"description":35,"category":8,"exclude":9,"forceFramework":9},"\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":37,"title":38,"description":39,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in % or px units.",{"path":41,"title":42,"description":43,"category":8,"exclude":9,"forceFramework":9},"\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":45,"title":46,"description":47,"category":8,"exclude":9,"forceFramework":9},"\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":49,"title":50,"description":51,"category":8,"exclude":9,"forceFramework":9},"\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":53,"title":54,"description":55,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fperformance","Performance","Learn what makes an effect expensive on the GPU and how to keep it inside the frame budget.",{"path":57,"title":58,"description":59,"category":8,"exclude":9,"forceFramework":9},"\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":61,"title":62,"description":63,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":65,"title":66,"description":67,"category":68,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fmcp","Shaders MCP","Connect your AI coding agent to Shaders so it can find, install and edit effects in your codebase.","workflows",{"path":70,"title":71,"description":72,"category":68,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fcli","Shaders CLI","Install shaders and presets into your codebase as component files, and keep them in sync with the design editor.",{"path":74,"title":75,"description":76,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fquick-tour-of-the-design-editor","Quick tour of the design editor","A short walkthrough of the full Shaders workflow, from designing on the infinite canvas to exporting code.","editor",{"path":79,"title":80,"description":81,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fintro-to-the-interface","Intro to the interface","A tour of the design editor interface: the canvas, layers, the Properties panel, and the ways to share and export.",{"path":83,"title":84,"description":85,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fcomposing-your-first-shader-effect","Composing your first shader effect","Building a first shader effect in the design editor by stacking and nesting components as layers.",{"path":87,"title":88,"description":89,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fmasking-and-blending","Masking and blending","How blend modes and masks combine components in the design editor.",{"path":91,"title":92,"description":93,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fdynamic-prop-mapping","Dynamic prop mapping","Turning static props into dynamic ones in the design editor: mapping one layer's output into another's prop, following the cursor, or animating automatically.",{"path":95,"title":96,"description":97,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fcustom-media-and-transformations","Custom media and transformations","Uploading images, videos, and SVG files to the media gallery, adding them to a composition, and placing them with transformations.",{"path":99,"title":100,"description":101,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Finstalling-a-shader-via-mcp","Installing a shader via MCP","Installing a shader from the design editor into a hero section with the Shaders MCP.",{"path":103,"title":104,"description":105,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fexploring-shape-effects","Exploring shape effects","Applying shape effects such as liquid glass, liquid metal, and glowing edges to built-in shapes and your own SVG.",{"path":107,"title":108,"description":109,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fglass-component-spotlight","Component spotlight: Glass","A short look at the Glass component and the liquid-glass look it creates.",{"path":111,"title":112,"description":113,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fdigital-looks-component-spotlight","Component spotlight: Digital looks","A look at the digital stylization components for glitchy, futuristic, or technical effects.",{"path":115,"title":12,"description":116,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fjs\u002Fquickstart","Install Shaders without a framework, render your first effect on a canvas, and update props at runtime.",{"path":118,"title":12,"description":119,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Freact\u002Fquickstart","Install Shaders in a React app, render your first effect, and drive a prop from state.",{"path":121,"title":122,"description":123,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Freact\u002Fssr","Next.js and SSR","Render Shaders in Next.js and other React SSR apps by keeping each shader on the client.",{"path":125,"title":12,"description":126,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fsolid\u002Fquickstart","Install Shaders in a Solid app, render your first effect, and drive a prop from a signal.",{"path":128,"title":129,"description":130,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fsolid\u002Fssr","SolidStart and SSR","Render Shaders in SolidStart and other Solid SSR apps by keeping each shader on the client.",{"path":132,"title":12,"description":133,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fsvelte\u002Fquickstart","Install Shaders in a Svelte app, render your first effect, and drive a prop from state.",{"path":135,"title":136,"description":137,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fsvelte\u002Fssr","SvelteKit and SSR","Render Shaders in SvelteKit and other Svelte SSR apps, where each shader already waits for the browser.",{"path":139,"title":12,"description":140,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fvue\u002Fquickstart","Install Shaders in a Vue app, render your first effect, and drive a prop from a ref.",{"path":142,"title":143,"description":144,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fvue\u002Fssr","Nuxt and SSR","Render Shaders in Nuxt and other Vue SSR apps by keeping each shader on the client.",{"id":146,"title":147,"body":148,"categoryId":1344,"categorySlug":1345,"categoryTitle":9,"curated":361,"description":1346,"editUrl":1347,"extension":1348,"group":1349,"groupTitle":1350,"kind":9,"meta":1351,"navigation":361,"path":1352,"seo":1353,"sourceUrl":1354,"stem":1355,"wordCount":207,"__hash__":1356},"primitives\u002Fdocs\u002Fprimitives\u002F39.sim-feedback\u002Findex.md","Feedback",{"type":149,"value":150,"toc":1338},"minimark",[151,155,167,183,194,223,228,295,299,1257,1261,1315,1319,1334],[152,153,147],"h1",{"id":154},"feedback",[156,157,158,159,166],"p",{},"Effects that remember the last frame. A feedback simulation keeps a picture of its own\nprevious output and advances it by one step of your rule every frame: read last frame's state,\napply the rule, write the new state. Temporal echoes, codec smears and decaying trails all live\nhere. ",[160,161,163],"a",{"href":162},"\u002Fdocs\u002Fprimitives\u002Fsim-feedback\u002Ffeedbacksim",[8,164,165],{},"feedbackSim"," keeps the two state textures and swaps them, keeps a display copy the layer\nsamples, binds the child's picture once it exists, and runs a clock you can scale with a speed\nprop.",[156,168,169,170,174,175,178,179,182],{},"You bring one ",[171,172,173],"strong",{},"step"," (a GPU function run once per state cell that reads the previous state\nand writes the next) and the ",[8,176,177],{},"values"," it reads each frame. The build callback runs once per\ninstance of the layer; pick the step's variant there when a compile-time prop changes it. The\nfragment samples ",[8,180,181],{},"display"," and mixes it with the live child however the effect wants. Without a\nGPU nothing runs, so the fragment should fall back to the child.",[156,184,185,186,189,190,193],{},"The simulation needs a child. For a wave field or a displacement, ",[8,187,188],{},"simulate.grid"," says it\nwithout GPU code; for a rule that runs many iterations per frame, see ",[8,191,192],{},"sim.grids",".",[195,196,201],"pre",{"className":197,"code":198,"language":199,"meta":200,"style":200},"language-ts shiki shiki-themes github-dark","import {sim} from 'shaders\u002Fstd'\n","ts","",[8,202,203],{"__ignoreMap":200},[204,205,208,212,216,219],"span",{"class":206,"line":207},"line",1,[204,209,211],{"class":210},"snl16","import",[204,213,215],{"class":214},"s95oV"," {sim} ",[204,217,218],{"class":210},"from",[204,220,222],{"class":221},"sU2Wk"," 'shaders\u002Fstd'\n",[224,225,227],"h2",{"id":226},"reach-for-it-when","Reach for it when",[229,230,231,244],"table",{},[232,233,234],"thead",{},[235,236,237,241],"tr",{},[238,239,240],"th",{},"When you need",[238,242,243],{},"Use",[245,246,247,259,271,283],"tbody",{},[235,248,249,253],{},[250,251,252],"td",{},"a codec smear, a temporal echo, a decaying trail of the layer inside",[250,254,255],{},[160,256,257],{"href":162},[8,258,165],{},[235,260,261,264],{},[250,262,263],{},"the effect should pause or run faster from a prop",[250,265,266,267],{},"the speedProp option of ",[160,268,269],{"href":162},[8,270,165],{},[235,272,273,276],{},[250,274,275],{},"a second texture that must swap with the state",[250,277,278,279],{},"the extraSlots option of ",[160,280,281],{"href":162},[8,282,165],{},[235,284,285,288],{},[250,286,287],{},"skip the whole step while a prop is 0",[250,289,290,291],{},"the skip option of ",[160,292,293],{"href":162},[8,294,165],{},[224,296,298],{"id":297},"example","Example",[195,300,302],{"className":197,"code":301,"language":199,"meta":200,"style":200},"import {defineShader, sim} from 'shaders\u002Fstd'\nimport {buildMacroblockAdvectKernel, call, mixExpr, ZERO} from '@coreroot\u002Fgpu\u002Fporters'\nimport type {GpuFragmentParams, KitTexture, Expr} from '@coreroot\u002Fgpu\u002Fporters'\nimport {blend} from '@coreroot\u002Fgpu\u002Fkit'\n\nconst {feedbackSim} = sim.feedback\n\nconst STATE_RES = 768\n\n\u002F\u002F The rule: each block of the picture either refreshes from the live child or holds and drags\n\u002F\u002F its previous contents along a motion vector, like a video stream that lost its keyframes.\nconst decoder = buildMacroblockAdvectKernel({\n  res: STATE_RES,\n  format: 'rgba16float',\n  namePrefix: 'dataMosh',\n  blockMix: {coarseScale: 2.6, coarsePick: 0.35},\n  generationLoss: {levels: 18, amount: 0.12, decay: 0.9985},\n})\n\n\u002F\u002F DataMosh: corrupted-codec smearing of the layer inside.\nexport const DataMosh = defineShader({\n  name: 'DataMosh',\n  requiresRTT: true,\n  requiresChild: true,\n  props: {\n    intensity: {default: 0.7},\n    blockSize: {default: 48},\n    drift: {default: 0.35},\n    churn: {default: 0.4},\n    blend: {default: 1},\n    speed: {default: 1},\n    seed: {default: 0},\n  },\n  ...feedbackSim((params, root) => ({\n    size: STATE_RES,\n    format: 'rgba16float',\n    speedProp: 'speed',\n    paramsSchema: decoder.Params,\n    \u002F\u002F Hand the step the child, last frame's state, this frame's state, the display copy and the values.\n    bindGroups: ({childTexture, display, paramsBuffer}, read, write) => root.createBindGroup(decoder.layout, {\n      src: childTexture, prev: read.state, next: write.state, display, params: paramsBuffer,\n    } as never),\n    step: decoder.kernel,\n    \u002F\u002F The simulation's own clock stops with speed 0, so the smear freezes in place.\n    values: ({dt, localTime}) => ({\n      time: localTime,\n      dt,\n      seed: (params.getCpuValue('seed') as number) ?? 0,\n      intensity: (params.getCpuValue('intensity') as number) ?? 0.7,\n      blockSize: (params.getCpuValue('blockSize') as number) ?? 48,\n      drift: (params.getCpuValue('drift') as number) ?? 0.35,\n      churn: (params.getCpuValue('churn') as number) ?? 0.4,\n    }),\n  })),\n  gpu: {\n    fragment: ({childNode, ctx, computeOutputs, uniforms, convertToTexture}: GpuFragmentParams): Expr => {\n      if (!childNode) return ZERO\n      const display = computeOutputs?.display as KitTexture | undefined\n      const childTex = (computeOutputs?.childTexture as KitTexture | undefined) ?? convertToTexture(childNode)\n      const live = childTex.sample(ctx.uv)\n      if (!display) return call(blend.unpremultiplyAlpha, 'unpremultiplyAlpha', [live]) \u002F\u002F no GPU: the child untouched\n      const moshed = display.sample(ctx.uv, 'linearClamp')\n      return call(blend.unpremultiplyAlpha, 'unpremultiplyAlpha', [mixExpr(live, moshed, uniforms.blend)])\n    },\n  },\n})\n",[8,303,304,315,328,343,356,363,384,389,403,408,415,421,438,450,461,472,490,513,519,524,530,549,560,571,581,587,598,609,619,630,641,651,662,668,698,708,718,729,735,741,786,792,807,813,819,842,848,854,886,914,942,970,998,1004,1010,1016,1070,1091,1116,1148,1167,1196,1220,1241,1247,1252],{"__ignoreMap":200},[204,305,306,308,311,313],{"class":206,"line":207},[204,307,211],{"class":210},[204,309,310],{"class":214}," {defineShader, sim} ",[204,312,218],{"class":210},[204,314,222],{"class":221},[204,316,318,320,323,325],{"class":206,"line":317},2,[204,319,211],{"class":210},[204,321,322],{"class":214}," {buildMacroblockAdvectKernel, call, mixExpr, ZERO} ",[204,324,218],{"class":210},[204,326,327],{"class":221}," '@coreroot\u002Fgpu\u002Fporters'\n",[204,329,331,333,336,339,341],{"class":206,"line":330},3,[204,332,211],{"class":210},[204,334,335],{"class":210}," type",[204,337,338],{"class":214}," {GpuFragmentParams, KitTexture, Expr} ",[204,340,218],{"class":210},[204,342,327],{"class":221},[204,344,346,348,351,353],{"class":206,"line":345},4,[204,347,211],{"class":210},[204,349,350],{"class":214}," {blend} ",[204,352,218],{"class":210},[204,354,355],{"class":221}," '@coreroot\u002Fgpu\u002Fkit'\n",[204,357,359],{"class":206,"line":358},5,[204,360,362],{"emptyLinePlaceholder":361},true,"\n",[204,364,366,369,372,375,378,381],{"class":206,"line":365},6,[204,367,368],{"class":210},"const",[204,370,371],{"class":214}," {",[204,373,165],{"class":374},"sDLfK",[204,376,377],{"class":214},"} ",[204,379,380],{"class":210},"=",[204,382,383],{"class":214}," sim.feedback\n",[204,385,387],{"class":206,"line":386},7,[204,388,362],{"emptyLinePlaceholder":361},[204,390,392,394,397,400],{"class":206,"line":391},8,[204,393,368],{"class":210},[204,395,396],{"class":374}," STATE_RES",[204,398,399],{"class":210}," =",[204,401,402],{"class":374}," 768\n",[204,404,406],{"class":206,"line":405},9,[204,407,362],{"emptyLinePlaceholder":361},[204,409,411],{"class":206,"line":410},10,[204,412,414],{"class":413},"sAwPA","\u002F\u002F The rule: each block of the picture either refreshes from the live child or holds and drags\n",[204,416,418],{"class":206,"line":417},11,[204,419,420],{"class":413},"\u002F\u002F its previous contents along a motion vector, like a video stream that lost its keyframes.\n",[204,422,424,426,429,431,435],{"class":206,"line":423},12,[204,425,368],{"class":210},[204,427,428],{"class":374}," decoder",[204,430,399],{"class":210},[204,432,434],{"class":433},"svObZ"," buildMacroblockAdvectKernel",[204,436,437],{"class":214},"({\n",[204,439,441,444,447],{"class":206,"line":440},13,[204,442,443],{"class":214},"  res: ",[204,445,446],{"class":374},"STATE_RES",[204,448,449],{"class":214},",\n",[204,451,453,456,459],{"class":206,"line":452},14,[204,454,455],{"class":214},"  format: ",[204,457,458],{"class":221},"'rgba16float'",[204,460,449],{"class":214},[204,462,464,467,470],{"class":206,"line":463},15,[204,465,466],{"class":214},"  namePrefix: ",[204,468,469],{"class":221},"'dataMosh'",[204,471,449],{"class":214},[204,473,475,478,481,484,487],{"class":206,"line":474},16,[204,476,477],{"class":214},"  blockMix: {coarseScale: ",[204,479,480],{"class":374},"2.6",[204,482,483],{"class":214},", coarsePick: ",[204,485,486],{"class":374},"0.35",[204,488,489],{"class":214},"},\n",[204,491,493,496,499,502,505,508,511],{"class":206,"line":492},17,[204,494,495],{"class":214},"  generationLoss: {levels: ",[204,497,498],{"class":374},"18",[204,500,501],{"class":214},", amount: ",[204,503,504],{"class":374},"0.12",[204,506,507],{"class":214},", decay: ",[204,509,510],{"class":374},"0.9985",[204,512,489],{"class":214},[204,514,516],{"class":206,"line":515},18,[204,517,518],{"class":214},"})\n",[204,520,522],{"class":206,"line":521},19,[204,523,362],{"emptyLinePlaceholder":361},[204,525,527],{"class":206,"line":526},20,[204,528,529],{"class":413},"\u002F\u002F DataMosh: corrupted-codec smearing of the layer inside.\n",[204,531,533,536,539,542,544,547],{"class":206,"line":532},21,[204,534,535],{"class":210},"export",[204,537,538],{"class":210}," const",[204,540,541],{"class":374}," DataMosh",[204,543,399],{"class":210},[204,545,546],{"class":433}," defineShader",[204,548,437],{"class":214},[204,550,552,555,558],{"class":206,"line":551},22,[204,553,554],{"class":214},"  name: ",[204,556,557],{"class":221},"'DataMosh'",[204,559,449],{"class":214},[204,561,563,566,569],{"class":206,"line":562},23,[204,564,565],{"class":214},"  requiresRTT: ",[204,567,568],{"class":374},"true",[204,570,449],{"class":214},[204,572,574,577,579],{"class":206,"line":573},24,[204,575,576],{"class":214},"  requiresChild: ",[204,578,568],{"class":374},[204,580,449],{"class":214},[204,582,584],{"class":206,"line":583},25,[204,585,586],{"class":214},"  props: {\n",[204,588,590,593,596],{"class":206,"line":589},26,[204,591,592],{"class":214},"    intensity: {default: ",[204,594,595],{"class":374},"0.7",[204,597,489],{"class":214},[204,599,601,604,607],{"class":206,"line":600},27,[204,602,603],{"class":214},"    blockSize: {default: ",[204,605,606],{"class":374},"48",[204,608,489],{"class":214},[204,610,612,615,617],{"class":206,"line":611},28,[204,613,614],{"class":214},"    drift: {default: ",[204,616,486],{"class":374},[204,618,489],{"class":214},[204,620,622,625,628],{"class":206,"line":621},29,[204,623,624],{"class":214},"    churn: {default: ",[204,626,627],{"class":374},"0.4",[204,629,489],{"class":214},[204,631,633,636,639],{"class":206,"line":632},30,[204,634,635],{"class":214},"    blend: {default: ",[204,637,638],{"class":374},"1",[204,640,489],{"class":214},[204,642,644,647,649],{"class":206,"line":643},31,[204,645,646],{"class":214},"    speed: {default: ",[204,648,638],{"class":374},[204,650,489],{"class":214},[204,652,654,657,660],{"class":206,"line":653},32,[204,655,656],{"class":214},"    seed: {default: ",[204,658,659],{"class":374},"0",[204,661,489],{"class":214},[204,663,665],{"class":206,"line":664},33,[204,666,667],{"class":214},"  },\n",[204,669,671,674,676,679,683,686,689,692,695],{"class":206,"line":670},34,[204,672,673],{"class":210},"  ...",[204,675,165],{"class":433},[204,677,678],{"class":214},"((",[204,680,682],{"class":681},"s9osk","params",[204,684,685],{"class":214},", ",[204,687,688],{"class":681},"root",[204,690,691],{"class":214},") ",[204,693,694],{"class":210},"=>",[204,696,697],{"class":214}," ({\n",[204,699,701,704,706],{"class":206,"line":700},35,[204,702,703],{"class":214},"    size: ",[204,705,446],{"class":374},[204,707,449],{"class":214},[204,709,711,714,716],{"class":206,"line":710},36,[204,712,713],{"class":214},"    format: ",[204,715,458],{"class":221},[204,717,449],{"class":214},[204,719,721,724,727],{"class":206,"line":720},37,[204,722,723],{"class":214},"    speedProp: ",[204,725,726],{"class":221},"'speed'",[204,728,449],{"class":214},[204,730,732],{"class":206,"line":731},38,[204,733,734],{"class":214},"    paramsSchema: decoder.Params,\n",[204,736,738],{"class":206,"line":737},39,[204,739,740],{"class":413},"    \u002F\u002F Hand the step the child, last frame's state, this frame's state, the display copy and the values.\n",[204,742,744,747,750,753,755,757,759,762,765,768,770,773,775,777,780,783],{"class":206,"line":743},40,[204,745,746],{"class":433},"    bindGroups",[204,748,749],{"class":214},": ({",[204,751,752],{"class":681},"childTexture",[204,754,685],{"class":214},[204,756,181],{"class":681},[204,758,685],{"class":214},[204,760,761],{"class":681},"paramsBuffer",[204,763,764],{"class":214},"}, ",[204,766,767],{"class":681},"read",[204,769,685],{"class":214},[204,771,772],{"class":681},"write",[204,774,691],{"class":214},[204,776,694],{"class":210},[204,778,779],{"class":214}," root.",[204,781,782],{"class":433},"createBindGroup",[204,784,785],{"class":214},"(decoder.layout, {\n",[204,787,789],{"class":206,"line":788},41,[204,790,791],{"class":214},"      src: childTexture, prev: read.state, next: write.state, display, params: paramsBuffer,\n",[204,793,795,798,801,804],{"class":206,"line":794},42,[204,796,797],{"class":214},"    } ",[204,799,800],{"class":210},"as",[204,802,803],{"class":374}," never",[204,805,806],{"class":214},"),\n",[204,808,810],{"class":206,"line":809},43,[204,811,812],{"class":214},"    step: decoder.kernel,\n",[204,814,816],{"class":206,"line":815},44,[204,817,818],{"class":413},"    \u002F\u002F The simulation's own clock stops with speed 0, so the smear freezes in place.\n",[204,820,822,825,827,830,832,835,838,840],{"class":206,"line":821},45,[204,823,824],{"class":433},"    values",[204,826,749],{"class":214},[204,828,829],{"class":681},"dt",[204,831,685],{"class":214},[204,833,834],{"class":681},"localTime",[204,836,837],{"class":214},"}) ",[204,839,694],{"class":210},[204,841,697],{"class":214},[204,843,845],{"class":206,"line":844},46,[204,846,847],{"class":214},"      time: localTime,\n",[204,849,851],{"class":206,"line":850},47,[204,852,853],{"class":214},"      dt,\n",[204,855,857,860,863,866,869,871,873,876,878,881,884],{"class":206,"line":856},48,[204,858,859],{"class":214},"      seed: (params.",[204,861,862],{"class":433},"getCpuValue",[204,864,865],{"class":214},"(",[204,867,868],{"class":221},"'seed'",[204,870,691],{"class":214},[204,872,800],{"class":210},[204,874,875],{"class":374}," number",[204,877,691],{"class":214},[204,879,880],{"class":210},"??",[204,882,883],{"class":374}," 0",[204,885,449],{"class":214},[204,887,889,892,894,896,899,901,903,905,907,909,912],{"class":206,"line":888},49,[204,890,891],{"class":214},"      intensity: (params.",[204,893,862],{"class":433},[204,895,865],{"class":214},[204,897,898],{"class":221},"'intensity'",[204,900,691],{"class":214},[204,902,800],{"class":210},[204,904,875],{"class":374},[204,906,691],{"class":214},[204,908,880],{"class":210},[204,910,911],{"class":374}," 0.7",[204,913,449],{"class":214},[204,915,917,920,922,924,927,929,931,933,935,937,940],{"class":206,"line":916},50,[204,918,919],{"class":214},"      blockSize: (params.",[204,921,862],{"class":433},[204,923,865],{"class":214},[204,925,926],{"class":221},"'blockSize'",[204,928,691],{"class":214},[204,930,800],{"class":210},[204,932,875],{"class":374},[204,934,691],{"class":214},[204,936,880],{"class":210},[204,938,939],{"class":374}," 48",[204,941,449],{"class":214},[204,943,945,948,950,952,955,957,959,961,963,965,968],{"class":206,"line":944},51,[204,946,947],{"class":214},"      drift: (params.",[204,949,862],{"class":433},[204,951,865],{"class":214},[204,953,954],{"class":221},"'drift'",[204,956,691],{"class":214},[204,958,800],{"class":210},[204,960,875],{"class":374},[204,962,691],{"class":214},[204,964,880],{"class":210},[204,966,967],{"class":374}," 0.35",[204,969,449],{"class":214},[204,971,973,976,978,980,983,985,987,989,991,993,996],{"class":206,"line":972},52,[204,974,975],{"class":214},"      churn: (params.",[204,977,862],{"class":433},[204,979,865],{"class":214},[204,981,982],{"class":221},"'churn'",[204,984,691],{"class":214},[204,986,800],{"class":210},[204,988,875],{"class":374},[204,990,691],{"class":214},[204,992,880],{"class":210},[204,994,995],{"class":374}," 0.4",[204,997,449],{"class":214},[204,999,1001],{"class":206,"line":1000},53,[204,1002,1003],{"class":214},"    }),\n",[204,1005,1007],{"class":206,"line":1006},54,[204,1008,1009],{"class":214},"  })),\n",[204,1011,1013],{"class":206,"line":1012},55,[204,1014,1015],{"class":214},"  gpu: {\n",[204,1017,1019,1022,1024,1027,1029,1032,1034,1037,1039,1042,1044,1047,1050,1053,1056,1059,1061,1064,1067],{"class":206,"line":1018},56,[204,1020,1021],{"class":433},"    fragment",[204,1023,749],{"class":214},[204,1025,1026],{"class":681},"childNode",[204,1028,685],{"class":214},[204,1030,1031],{"class":681},"ctx",[204,1033,685],{"class":214},[204,1035,1036],{"class":681},"computeOutputs",[204,1038,685],{"class":214},[204,1040,1041],{"class":681},"uniforms",[204,1043,685],{"class":214},[204,1045,1046],{"class":681},"convertToTexture",[204,1048,1049],{"class":214},"}",[204,1051,1052],{"class":210},":",[204,1054,1055],{"class":433}," GpuFragmentParams",[204,1057,1058],{"class":214},")",[204,1060,1052],{"class":210},[204,1062,1063],{"class":433}," Expr",[204,1065,1066],{"class":210}," =>",[204,1068,1069],{"class":214}," {\n",[204,1071,1073,1076,1079,1082,1085,1088],{"class":206,"line":1072},57,[204,1074,1075],{"class":210},"      if",[204,1077,1078],{"class":214}," (",[204,1080,1081],{"class":210},"!",[204,1083,1084],{"class":214},"childNode) ",[204,1086,1087],{"class":210},"return",[204,1089,1090],{"class":374}," ZERO\n",[204,1092,1094,1097,1100,1102,1105,1107,1110,1113],{"class":206,"line":1093},58,[204,1095,1096],{"class":210},"      const",[204,1098,1099],{"class":374}," display",[204,1101,399],{"class":210},[204,1103,1104],{"class":214}," computeOutputs?.display ",[204,1106,800],{"class":210},[204,1108,1109],{"class":433}," KitTexture",[204,1111,1112],{"class":210}," |",[204,1114,1115],{"class":374}," undefined\n",[204,1117,1119,1121,1124,1126,1129,1131,1133,1135,1138,1140,1142,1145],{"class":206,"line":1118},59,[204,1120,1096],{"class":210},[204,1122,1123],{"class":374}," childTex",[204,1125,399],{"class":210},[204,1127,1128],{"class":214}," (computeOutputs?.childTexture ",[204,1130,800],{"class":210},[204,1132,1109],{"class":433},[204,1134,1112],{"class":210},[204,1136,1137],{"class":374}," undefined",[204,1139,691],{"class":214},[204,1141,880],{"class":210},[204,1143,1144],{"class":433}," convertToTexture",[204,1146,1147],{"class":214},"(childNode)\n",[204,1149,1151,1153,1156,1158,1161,1164],{"class":206,"line":1150},60,[204,1152,1096],{"class":210},[204,1154,1155],{"class":374}," live",[204,1157,399],{"class":210},[204,1159,1160],{"class":214}," childTex.",[204,1162,1163],{"class":433},"sample",[204,1165,1166],{"class":214},"(ctx.uv)\n",[204,1168,1170,1172,1174,1176,1179,1181,1184,1187,1190,1193],{"class":206,"line":1169},61,[204,1171,1075],{"class":210},[204,1173,1078],{"class":214},[204,1175,1081],{"class":210},[204,1177,1178],{"class":214},"display) ",[204,1180,1087],{"class":210},[204,1182,1183],{"class":433}," call",[204,1185,1186],{"class":214},"(blend.unpremultiplyAlpha, ",[204,1188,1189],{"class":221},"'unpremultiplyAlpha'",[204,1191,1192],{"class":214},", [live]) ",[204,1194,1195],{"class":413},"\u002F\u002F no GPU: the child untouched\n",[204,1197,1199,1201,1204,1206,1209,1211,1214,1217],{"class":206,"line":1198},62,[204,1200,1096],{"class":210},[204,1202,1203],{"class":374}," moshed",[204,1205,399],{"class":210},[204,1207,1208],{"class":214}," display.",[204,1210,1163],{"class":433},[204,1212,1213],{"class":214},"(ctx.uv, ",[204,1215,1216],{"class":221},"'linearClamp'",[204,1218,1219],{"class":214},")\n",[204,1221,1223,1226,1228,1230,1232,1235,1238],{"class":206,"line":1222},63,[204,1224,1225],{"class":210},"      return",[204,1227,1183],{"class":433},[204,1229,1186],{"class":214},[204,1231,1189],{"class":221},[204,1233,1234],{"class":214},", [",[204,1236,1237],{"class":433},"mixExpr",[204,1239,1240],{"class":214},"(live, moshed, uniforms.blend)])\n",[204,1242,1244],{"class":206,"line":1243},64,[204,1245,1246],{"class":214},"    },\n",[204,1248,1250],{"class":206,"line":1249},65,[204,1251,667],{"class":214},[204,1253,1255],{"class":206,"line":1254},66,[204,1256,518],{"class":214},[224,1258,1260],{"id":1259},"types","Types",[229,1262,1263,1273],{},[232,1264,1265],{},[235,1266,1267,1270],{},[238,1268,1269],{},"Type",[238,1271,1272],{},"What it is",[245,1274,1275,1285,1295,1305],{},[235,1276,1277,1282],{},[250,1278,1279],{},[8,1280,1281],{},"FeedbackBindContext",[250,1283,1284],{},"What you get when wiring your layout: the child's picture, the display texture, any extra textures you declared, and the buffer holding your per-frame values.",[235,1286,1287,1292],{},[250,1288,1289],{},[8,1290,1291],{},"FeedbackKernel",[250,1293,1294],{},"A step function run once per state cell, with the cell's column and row.",[235,1296,1297,1302],{},[250,1298,1299],{},[8,1300,1301],{},"FeedbackRoot",[250,1303,1304],{},"The GPU device handle the build callback receives, for creating the resources your step reads.",[235,1306,1307,1312],{},[250,1308,1309],{},[8,1310,1311],{},"FeedbackSimConfig",[250,1313,1314],{},"What a feedback simulation declares: the state's size and format, one step function, the wiring that hands it the read and write sides, and the values it reads each frame.",[224,1316,1318],{"id":1317},"words","Words",[1320,1321,1323],"primitive-words",{":words":1322},"[{\"name\":\"feedbackSim\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-feedback\u002Ffeedbacksim\",\"summary\":\"A simulation that advances a picture of its own last frame by one step of your rule, every frame.\"}]",[1324,1325,1326],"ul",{},[1327,1328,1329,1333],"li",{},[160,1330,1331],{"href":162},[8,1332,165],{}," — A simulation that advances a picture of its own last frame by one step of your rule, every frame.",[1335,1336,1337],"style",{},"html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}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}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .s9osk, html code.shiki .s9osk{--shiki-default:#FFAB70}",{"title":200,"searchDepth":317,"depth":317,"links":1339},[1340,1341,1342,1343],{"id":226,"depth":317,"text":227},{"id":297,"depth":317,"text":298},{"id":1259,"depth":317,"text":1260},{"id":1317,"depth":317,"text":1318},"sim.feedback","sim-feedback","Effects that remember the last frame.","https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fedit\u002Fmain\u002Fpackages\u002Fcore\u002Fdocs\u002Fstd\u002Fsim.feedback.md","md","simulation","Simulation",{},"\u002Fdocs\u002Fprimitives\u002Fsim-feedback",{"title":147,"description":1346},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Fsim\u002Ffeedback.ts","docs\u002Fprimitives\u002F39.sim-feedback\u002Findex","pm_eqiF9kdKb0YyzaMyr_lTUdpQcdGh9a3NxY7C7HfU"]