[{"data":1,"prerenderedAt":268,"buildId":269},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fprimitives\u002Fdefine\u002Fdefinestd":3,"github-stars":176,"guide-nav":178},{"id":4,"title":5,"body":6,"categoryId":161,"categorySlug":161,"categoryTitle":162,"curated":163,"description":164,"editUrl":165,"extension":166,"group":161,"groupTitle":167,"kind":168,"meta":169,"navigation":170,"path":171,"seo":172,"sourceUrl":173,"stem":174,"wordCount":165,"__hash__":175},"primitives\u002Fdocs\u002Fprimitives\u002F1.define\u002F9.definestd.md","defineStd",{"type":7,"value":8,"toc":157},"minimark",[9,13,22,38,100,109,112,117,153],[10,11,5],"h1",{"id":12},"definestd",[14,15,16,17,21],"p",{},"The earlier name of ",[18,19,20],"code",{},"defineShader",".",[23,24,25],"blockquote",{},[14,26,27,31,32,34,35,37],{},[28,29,30],"strong",{},"Deprecated."," Use ",[18,33,20],{},". ",[18,36,5],{}," will be removed in the next major version.",[39,40,45],"pre",{"className":41,"code":42,"language":43,"meta":44,"style":44},"language-ts shiki shiki-themes github-dark","defineStd\u003CT extends ComponentProps>(input: StdDefinition\u003CT>): GpuShaderDefinition\u003CT>\n","ts","",[18,46,47],{"__ignoreMap":44},[48,49,52,56,60,64,67,70,74,77,80,83,85,88,90,93,95,97],"span",{"class":50,"line":51},"line",1,[48,53,55],{"class":54},"s95oV","defineStd\u003C",[48,57,59],{"class":58},"svObZ","T",[48,61,63],{"class":62},"snl16"," extends",[48,65,66],{"class":58}," ComponentProps",[48,68,69],{"class":54},">(",[48,71,73],{"class":72},"s9osk","input",[48,75,76],{"class":62},":",[48,78,79],{"class":58}," StdDefinition",[48,81,82],{"class":54},"\u003C",[48,84,59],{"class":58},[48,86,87],{"class":54},">)",[48,89,76],{"class":62},[48,91,92],{"class":58}," GpuShaderDefinition",[48,94,82],{"class":54},[48,96,59],{"class":58},[48,98,99],{"class":54},">\n",[14,101,102,103,105,106,21],{},"Import ",[18,104,5],{}," from ",[18,107,108],{},"shaders\u002Fstd",[14,110,111],{},"Same function; kept so code written against it still builds.",[113,114,116],"h2",{"id":115},"parameters","Parameters",[118,119,120,136],"table",{},[121,122,123],"thead",{},[124,125,126,130,133],"tr",{},[127,128,129],"th",{},"Name",[127,131,132],{},"Type",[127,134,135],{},"Notes",[137,138,139],"tbody",{},[124,140,141,146,151],{},[142,143,144],"td",{},[18,145,73],{},[142,147,148],{},[18,149,150],{},"StdDefinition\u003CT>",[142,152],{},[154,155,156],"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 pre.shiki code .s9osk, html code.shiki .s9osk{--shiki-default:#FFAB70}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":44,"searchDepth":158,"depth":158,"links":159},2,[160],{"id":115,"depth":158,"text":116},"define","defineShader & wgsl",false,"The earlier name of `defineShader`.",null,"md","Defining a shader","function",{},true,"\u002Fdocs\u002Fprimitives\u002Fdefine\u002Fdefinestd",{"title":5,"description":164},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Flower.ts#L850","docs\u002Fprimitives\u002F1.define\u002F9.definestd","cTId5wIcLEaW_1Y6Dp2KLa8dqZYEa1KDQJCJkrQ84y4",{"stars":177},6080,[179,183,187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,248,252,256,260,264],{"path":180,"title":181,"description":182,"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":184,"title":185,"description":186,"category":18},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",{"path":188,"title":189,"description":190,"category":18},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":192,"title":193,"description":194,"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":196,"title":197,"description":198,"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":200,"title":201,"description":202,"category":18},"\u002Fdocs\u002Fguide\u002Fanimation","Animating a shader","Tween a shader's props with Motion, GSAP or anything else that animates a number.",{"path":204,"title":205,"description":206,"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":208,"title":209,"description":210,"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":212,"title":213,"description":214,"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":216,"title":217,"description":218,"category":18},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in any CSS unit.",{"path":220,"title":221,"description":222,"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":224,"title":225,"description":226,"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":228,"title":229,"description":230,"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":232,"title":233,"description":234,"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":236,"title":237,"description":238,"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":240,"title":241,"description":242,"category":18},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":244,"title":245,"description":246,"category":247},"\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":249,"title":250,"description":251,"category":247},"\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":253,"title":254,"description":255,"category":247},"\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":257,"title":258,"description":259,"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":261,"title":262,"description":263,"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":265,"title":266,"description":267,"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.",1796051172517,"06e02370-81a6-4d74-9931-661d71414be1"]