[{"data":1,"prerenderedAt":214,"buildId":215},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fprimitives\u002Feffects-overlay\u002Fstraightfrompremul":3,"github-stars":122,"guide-nav":124},{"id":4,"title":5,"body":6,"categoryId":107,"categorySlug":108,"categoryTitle":109,"curated":110,"description":16,"editUrl":111,"extension":112,"group":44,"groupTitle":113,"kind":114,"meta":115,"navigation":116,"path":117,"seo":118,"sourceUrl":119,"stem":120,"wordCount":111,"__hash__":121},"primitives\u002Fdocs\u002Fprimitives\u002F34.effects-overlay\u002F6.straightfrompremul.md","straightFromPremul",{"type":7,"value":8,"toc":103},"minimark",[9,13,17,39,54,57,62,99],[10,11,5],"h1",{"id":12},"straightfrompremul",[14,15,16],"p",{},"The overlay output convention: the draw accumulator is premultiplied; the fragment returns straight alpha.",[18,19,24],"pre",{"className":20,"code":21,"language":22,"meta":23,"style":23},"language-ts shiki shiki-themes github-dark","straightFromPremul(dst: string): string\n","ts","",[25,26,27],"code",{"__ignoreMap":23},[28,29,32,35],"span",{"class":30,"line":31},"line",1,[28,33,5],{"class":34},"svObZ",[28,36,38],{"class":37},"s95oV","(dst: string): string\n",[14,40,41,42,45,46,49,50,53],{},"Import ",[25,43,44],{},"effects"," from ",[25,47,48],{},"shaders\u002Fstd"," and use ",[25,51,52],{},"effects.overlay.straightFromPremul",".",[14,55,56],{},"Returns the final expression string.",[58,59,61],"h2",{"id":60},"parameters","Parameters",[63,64,65,81],"table",{},[66,67,68],"thead",{},[69,70,71,75,78],"tr",{},[72,73,74],"th",{},"Name",[72,76,77],{},"Type",[72,79,80],{},"Notes",[82,83,84],"tbody",{},[69,85,86,92,97],{},[87,88,89],"td",{},[25,90,91],{},"dst",[87,93,94],{},[25,95,96],{},"string",[87,98],{},[100,101,102],"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);}",{"title":23,"searchDepth":104,"depth":104,"links":105},2,[106],{"id":60,"depth":104,"text":61},"effects.overlay","effects-overlay","Overlays",false,null,"md","Filters & effects","function",{},true,"\u002Fdocs\u002Fprimitives\u002Feffects-overlay\u002Fstraightfrompremul",{"title":5,"description":16},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Feffects\u002Foverlay.ts#L68","docs\u002Fprimitives\u002F34.effects-overlay\u002F6.straightfrompremul","EnxOcZga-uN5QHKneKZsWFLs2v8oZRv2FlVuJImx82w",{"stars":123},6080,[125,129,133,137,141,145,149,153,157,161,165,169,173,177,181,185,189,194,198,202,206,210],{"path":126,"title":127,"description":128,"category":25},"\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":130,"title":131,"description":132,"category":25},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",{"path":134,"title":135,"description":136,"category":25},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":138,"title":139,"description":140,"category":25},"\u002Fdocs\u002Fguide\u002Fblending-masking","Blending and masking","Control how a layer mixes with the layers below it, and reveal one layer through another.",{"path":142,"title":143,"description":144,"category":25},"\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":146,"title":147,"description":148,"category":25},"\u002Fdocs\u002Fguide\u002Fanimation","Animating a shader","Tween a shader's props with Motion, GSAP or anything else that animates a number.",{"path":150,"title":151,"description":152,"category":25},"\u002Fdocs\u002Fguide\u002Fdynamic-props","Dynamic props","Drive any numeric or position prop from time, the cursor, or another layer, without writing animation code.",{"path":154,"title":155,"description":156,"category":25},"\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":158,"title":159,"description":160,"category":25},"\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":162,"title":163,"description":164,"category":25},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in any CSS unit.",{"path":166,"title":167,"description":168,"category":25},"\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":170,"title":171,"description":172,"category":25},"\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":174,"title":175,"description":176,"category":25},"\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":178,"title":179,"description":180,"category":25},"\u002Fdocs\u002Fguide\u002Fperformance","Performance","Learn what makes an effect expensive on the GPU and how to keep it inside the frame budget.",{"path":182,"title":183,"description":184,"category":25},"\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":186,"title":187,"description":188,"category":25},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":190,"title":191,"description":192,"category":193},"\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":195,"title":196,"description":197,"category":193},"\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":199,"title":200,"description":201,"category":193},"\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":203,"title":204,"description":205,"category":25},"\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":207,"title":208,"description":209,"category":25},"\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":211,"title":212,"description":213,"category":25},"\u002Fdocs\u002Fguide\u002Fssr","Server rendering","Render Shaders in Next.js, Nuxt, SvelteKit, SolidStart and other SSR apps by keeping each shader on the client.",1796051185891,"06e02370-81a6-4d74-9931-661d71414be1"]