[{"data":1,"prerenderedAt":311,"buildId":312},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fprimitives\u002Finputs-compute":3,"github-stars":219,"guide-nav":221},{"id":4,"title":5,"body":6,"categoryId":204,"categorySlug":205,"categoryTitle":206,"curated":207,"description":208,"editUrl":209,"extension":210,"group":126,"groupTitle":211,"kind":206,"meta":212,"navigation":213,"path":214,"seo":215,"sourceUrl":209,"stem":216,"wordCount":217,"__hash__":218},"primitives\u002Fdocs\u002Fprimitives\u002F41.inputs-compute\u002Findex.md","Raw compute",{"type":7,"value":8,"toc":199},"minimark",[9,13,40,69,74,155,159,195],[10,11,5],"h1",{"id":12},"raw-compute",[14,15,16,17,25,26,32,33,39],"p",{},"The raw compute tier: records (",[18,19,21],"a",{"href":20},"\u002Fdocs\u002Fprimitives\u002Finputs-compute\u002Fstruct",[22,23,24],"code",{},"struct","), storage buffers of them (",[18,27,29],{"href":28},"\u002Fdocs\u002Fprimitives\u002Finputs-compute\u002Fbuffer",[22,30,31],{},"buffer","), and your own compute passes over them (",[18,34,36],{"href":35},"\u002Fdocs\u002Fprimitives\u002Finputs-compute\u002Fkernel",[22,37,38],{},"kernel","). For anything the simulation words do not cover. The engine still owns the bind groups, workgroup sizes, bounds checks and dispatch.",[41,42,47],"pre",{"className":43,"code":44,"language":45,"meta":46,"style":46},"language-ts shiki shiki-themes github-dark","import {buffer, kernel, struct} from 'shaders\u002Fstd'\n","ts","",[22,48,49],{"__ignoreMap":46},[50,51,54,58,62,65],"span",{"class":52,"line":53},"line",1,[50,55,57],{"class":56},"snl16","import",[50,59,61],{"class":60},"s95oV"," {buffer, kernel, struct} ",[50,63,64],{"class":56},"from",[50,66,68],{"class":67},"sU2Wk"," 'shaders\u002Fstd'\n",[70,71,73],"h2",{"id":72},"types","Types",[75,76,77,90],"table",{},[78,79,80],"thead",{},[81,82,83,87],"tr",{},[84,85,86],"th",{},"Type",[84,88,89],{},"What it is",[91,92,93,104,114,132,145],"tbody",{},[81,94,95,101],{},[96,97,98],"td",{},[22,99,100],{},"BufferHandle",[96,102,103],{},"A storage buffer a sibling kernel can read and write.",[81,105,106,111],{},[96,107,108],{},[22,109,110],{},"BufferInput",[96,112,113],{},"interface BufferInput extends InputNode { readonly kind: 'buffer' readonly type: StructType readonly count: ScalarArg readonly max: number }",[81,115,116,121],{},[96,117,118],{},[22,119,120],{},"KernelInput",[96,122,123,124,127,128,131],{},"interface KernelInput extends InputNode { readonly kind: 'kernel' readonly body: string \u002F** The buffer (by its ",[22,125,126],{},"inputs"," name) to run once per element of, or a fixed grid size. *\u002F readonly over: string | readonly ",[50,129,130],{},"number, number"," readonly iterations: number readonly when: 'frame' | 'init' }",[81,133,134,139],{},[96,135,136],{},[22,137,138],{},"StructFieldType",[96,140,141,142,144],{},"The field types a ",[22,143,24],{}," may hold.",[81,146,147,152],{},[96,148,149],{},[22,150,151],{},"StructType",[96,153,154],{},"A record type, by name, for buffers and kernels.",[70,156,158],{"id":157},"words","Words",[160,161,163],"primitive-words",{":words":162},"[{\"name\":\"buffer\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Finputs-compute\u002Fbuffer\",\"summary\":\"A storage buffer of `count` records of a `struct` type, zero-filled.\"},{\"name\":\"kernel\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Finputs-compute\u002Fkernel\",\"summary\":\"Your own compute pass.\"},{\"name\":\"struct\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Finputs-compute\u002Fstruct\",\"summary\":\"Declare a record type.\"}]",[164,165,166,181,188],"ul",{},[167,168,169,173,174,177,178,180],"li",{},[18,170,171],{"href":28},[22,172,31],{}," — A storage buffer of ",[22,175,176],{},"count"," records of a ",[22,179,24],{}," type, zero-filled.",[167,182,183,187],{},[18,184,185],{"href":35},[22,186,38],{}," — Your own compute pass.",[167,189,190,194],{},[18,191,192],{"href":20},[22,193,24],{}," — Declare a record type.",[196,197,198],"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);}",{"title":46,"searchDepth":200,"depth":200,"links":201},2,[202,203],{"id":72,"depth":200,"text":73},{"id":157,"depth":200,"text":158},"inputs.compute","inputs-compute",null,false,"The raw compute tier: records (struct), storage buffers of them (buffer), and your own compute passes over them (kernel).","https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Finputs\u002Fcompute.ts","md","Inputs",{},true,"\u002Fdocs\u002Fprimitives\u002Finputs-compute",{"title":5,"description":208},"docs\u002Fprimitives\u002F41.inputs-compute\u002Findex",3,"4AW-M3iTmQg5rD_fPh_PxUjf_d5sBWNmCIBHgu6Xqn4",{"stars":220},6080,[222,226,230,234,238,242,246,250,254,258,262,266,270,274,278,282,286,291,295,299,303,307],{"path":223,"title":224,"description":225,"category":22},"\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":227,"title":228,"description":229,"category":22},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",{"path":231,"title":232,"description":233,"category":22},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":235,"title":236,"description":237,"category":22},"\u002Fdocs\u002Fguide\u002Fblending-masking","Blending and masking","Control how a layer mixes with the layers below it, and reveal one layer through another.",{"path":239,"title":240,"description":241,"category":22},"\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":243,"title":244,"description":245,"category":22},"\u002Fdocs\u002Fguide\u002Fanimation","Animating a shader","Tween a shader's props with Motion, GSAP or anything else that animates a number.",{"path":247,"title":248,"description":249,"category":22},"\u002Fdocs\u002Fguide\u002Fdynamic-props","Dynamic props","Drive any numeric or position prop from time, the cursor, or another layer, without writing animation code.",{"path":251,"title":252,"description":253,"category":22},"\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":255,"title":256,"description":257,"category":22},"\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":259,"title":260,"description":261,"category":22},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in any CSS unit.",{"path":263,"title":264,"description":265,"category":22},"\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":267,"title":268,"description":269,"category":22},"\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":271,"title":272,"description":273,"category":22},"\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":275,"title":276,"description":277,"category":22},"\u002Fdocs\u002Fguide\u002Fperformance","Performance","Learn what makes an effect expensive on the GPU and how to keep it inside the frame budget.",{"path":279,"title":280,"description":281,"category":22},"\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":283,"title":284,"description":285,"category":22},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":287,"title":288,"description":289,"category":290},"\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":292,"title":293,"description":294,"category":290},"\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":296,"title":297,"description":298,"category":290},"\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":300,"title":301,"description":302,"category":22},"\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":304,"title":305,"description":306,"category":22},"\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":308,"title":309,"description":310,"category":22},"\u002Fdocs\u002Fguide\u002Fssr","Server rendering","Render Shaders in Next.js, Nuxt, SvelteKit, SolidStart and other SSR apps by keeping each shader on the client.",1796051186131,"06e02370-81a6-4d74-9931-661d71414be1"]