[{"data":1,"prerenderedAt":289,"buildId":290},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fprimitives\u002Finputs-passes\u002Fdownsample":3,"github-stars":197,"guide-nav":199},{"id":4,"title":5,"body":6,"categoryId":182,"categorySlug":183,"categoryTitle":184,"curated":185,"description":15,"editUrl":186,"extension":187,"group":120,"groupTitle":188,"kind":189,"meta":190,"navigation":191,"path":192,"seo":193,"sourceUrl":194,"stem":195,"wordCount":186,"__hash__":196},"primitives\u002Fdocs\u002Fprimitives\u002F39.inputs-passes\u002F2.downsample.md","downsample",{"type":7,"value":8,"toc":176},"minimark",[9,12,16,38,48,51,56,107,111,142,146,172],[10,11,5],"h1",{"id":5},[13,14,15],"p",{},"A smaller copy of a source, box-filtered so it does not alias.",[17,18,23],"pre",{"className":19,"code":20,"language":21,"meta":22,"style":22},"language-ts shiki shiki-themes github-dark","downsample(source: InputSource, opts: {scale: number}): DownsampleInput\n","ts","",[24,25,26],"code",{"__ignoreMap":22},[27,28,31,34],"span",{"class":29,"line":30},"line",1,[27,32,5],{"class":33},"svObZ",[27,35,37],{"class":36},"s95oV","(source: InputSource, opts: {scale: number}): DownsampleInput\n",[13,39,40,41,43,44,47],{},"Import ",[24,42,5],{}," from ",[24,45,46],{},"shaders\u002Fstd",".",[13,49,50],{},"Read it by name. Use it to make an expensive read cheap: sample the small copy many times instead of the full one.",[52,53,55],"h2",{"id":54},"parameters","Parameters",[57,58,59,75],"table",{},[60,61,62],"thead",{},[63,64,65,69,72],"tr",{},[66,67,68],"th",{},"Name",[66,70,71],{},"Type",[66,73,74],{},"Notes",[76,77,78,93],"tbody",{},[63,79,80,86,91],{},[81,82,83],"td",{},[24,84,85],{},"source",[81,87,88],{},[24,89,90],{},"InputSource",[81,92],{},[63,94,95,100,105],{},[81,96,97],{},[24,98,99],{},"opts",[81,101,102],{},[24,103,104],{},"{scale: number}",[81,106],{},[52,108,110],{"id":109},"example","Example",[17,112,114],{"className":19,"code":113,"language":21,"meta":22,"style":22},"inputs: {small: downsample(child, {scale: 0.25})},\n",[24,115,116],{"__ignoreMap":22},[27,117,118,121,124,127,130,132,135,139],{"class":29,"line":30},[27,119,120],{"class":33},"inputs",[27,122,123],{"class":36},": {",[27,125,126],{"class":33},"small",[27,128,129],{"class":36},": ",[27,131,5],{"class":33},[27,133,134],{"class":36},"(child, {scale: ",[27,136,138],{"class":137},"sDLfK","0.25",[27,140,141],{"class":36},"})},\n",[52,143,145],{"id":144},"see-also","See also",[147,148,149,160],"ul",{},[150,151,152,159],"li",{},[153,154,156],"a",{"href":155},"\u002Fdocs\u002Fprimitives\u002Finputs-blur\u002Fblur",[24,157,158],{},"blur"," — A blurred copy of a source, read in WGSL by the name you list it under.",[150,161,162,168,169,47],{},[153,163,165],{"href":164},"\u002Fdocs\u002Fprimitives\u002Finputs-passes\u002Fpass",[24,166,167],{},"pass"," — Your own WGSL, rendered into a texture every frame before the body runs, read by name: ",[24,170,171],{},"clouds(uv)",[173,174,175],"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 .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}",{"title":22,"searchDepth":177,"depth":177,"links":178},2,[179,180,181],{"id":54,"depth":177,"text":55},{"id":109,"depth":177,"text":110},{"id":144,"depth":177,"text":145},"inputs.passes","inputs-passes","Passes",false,null,"md","Inputs","function",{},true,"\u002Fdocs\u002Fprimitives\u002Finputs-passes\u002Fdownsample",{"title":5,"description":15},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Finputs\u002Fpasses.ts#L115","docs\u002Fprimitives\u002F39.inputs-passes\u002F2.downsample","ufYKZPMAqI2g17J_jr2Pif-KHbmrLTXSaMa6Ni0R5Qg",{"stars":198},6080,[200,204,208,212,216,220,224,228,232,236,240,244,248,252,256,260,264,269,273,277,281,285],{"path":201,"title":202,"description":203,"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":205,"title":206,"description":207,"category":24},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",{"path":209,"title":210,"description":211,"category":24},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":213,"title":214,"description":215,"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":217,"title":218,"description":219,"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":221,"title":222,"description":223,"category":24},"\u002Fdocs\u002Fguide\u002Fanimation","Animating a shader","Tween a shader's props with Motion, GSAP or anything else that animates a number.",{"path":225,"title":226,"description":227,"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":229,"title":230,"description":231,"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":233,"title":234,"description":235,"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":237,"title":238,"description":239,"category":24},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in any CSS unit.",{"path":241,"title":242,"description":243,"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":245,"title":246,"description":247,"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":249,"title":250,"description":251,"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":253,"title":254,"description":255,"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":257,"title":258,"description":259,"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":261,"title":262,"description":263,"category":24},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":265,"title":266,"description":267,"category":268},"\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":270,"title":271,"description":272,"category":268},"\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":274,"title":275,"description":276,"category":268},"\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":278,"title":279,"description":280,"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":282,"title":283,"description":284,"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":286,"title":287,"description":288,"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.",1796051186020,"06e02370-81a6-4d74-9931-661d71414be1"]