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