[{"data":1,"prerenderedAt":292,"buildId":293},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fprimitives\u002Fmath\u002Ffwidthfine":3,"github-stars":200,"guide-nav":202},{"id":4,"title":5,"body":6,"categoryId":47,"categorySlug":47,"categoryTitle":185,"curated":186,"description":187,"editUrl":188,"extension":189,"group":190,"groupTitle":191,"kind":192,"meta":193,"navigation":194,"path":195,"seo":196,"sourceUrl":197,"stem":198,"wordCount":188,"__hash__":199},"primitives\u002Fdocs\u002Fprimitives\u002F22.math\u002F53.fwidthfine.md","fwidthFine",{"type":7,"value":8,"toc":178},"minimark",[9,13,21,42,57,62,99,103,132,136,164,168,174],[10,11,5],"h1",{"id":12},"fwidthfine",[14,15,16,20],"p",{},[17,18,19],"code",{},"fwidth"," measured per pixel rather than per 2×2 pixel block.",[22,23,28],"pre",{"className":24,"code":25,"language":26,"meta":27,"style":27},"language-ts shiki shiki-themes github-dark","fwidthFine(x: Val): Expr\n","ts","",[17,29,30],{"__ignoreMap":27},[31,32,35,38],"span",{"class":33,"line":34},"line",1,[31,36,5],{"class":37},"svObZ",[31,39,41],{"class":40},"s95oV","(x: Val): Expr\n",[14,43,44,45,48,49,52,53,56],{},"Import ",[17,46,47],{},"math"," from ",[17,50,51],{},"shaders\u002Fstd"," and use ",[17,54,55],{},"math.fwidthFine",".",[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",{},[17,90,91],{},"x",[87,93,94],{},[17,95,96],{},"Val",[87,98],{},[58,100,102],{"id":101},"example","Example",[22,104,106],{"className":24,"code":105,"language":26,"meta":27,"style":27},"const blur = length(fwidthFine(reflected))\n",[17,107,108],{"__ignoreMap":27},[31,109,110,114,118,121,124,127,129],{"class":33,"line":34},[31,111,113],{"class":112},"snl16","const",[31,115,117],{"class":116},"sDLfK"," blur",[31,119,120],{"class":112}," =",[31,122,123],{"class":37}," length",[31,125,126],{"class":40},"(",[31,128,5],{"class":37},[31,130,131],{"class":40},"(reflected))\n",[58,133,135],{"id":134},"see-also","See also",[137,138,139,152],"ul",{},[140,141,142,148,149,56],"li",{},[143,144,146],"a",{"href":145},"\u002Fdocs\u002Fprimitives\u002Fmath\u002Ffwidth",[17,147,19],{}," — How much a value changes across one pixel, in any direction: ",[17,150,151],{},"|dpdx| + |dpdy|",[140,153,154,160,161,20],{},[143,155,157],{"href":156},"\u002Fdocs\u002Fprimitives\u002Fmath\u002Fdpdxfine",[17,158,159],{},"dpdxFine"," — ",[17,162,163],{},"dpdx",[58,165,167],{"id":166},"used-by","Used by",[14,169,170],{},[143,171,173],{"href":172},"\u002Fdocs\u002Fcomponents\u002Fprismaticglass","PrismaticGlass",[175,176,177],"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 .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}",{"title":27,"searchDepth":179,"depth":179,"links":180},2,[181,182,183,184],{"id":60,"depth":179,"text":61},{"id":101,"depth":179,"text":102},{"id":134,"depth":179,"text":135},{"id":166,"depth":179,"text":167},"Math",false,"`fwidth` measured per pixel rather than per 2×2 pixel block.",null,"md","space","Shapes, frames & warps","function",{},true,"\u002Fdocs\u002Fprimitives\u002Fmath\u002Ffwidthfine",{"title":5,"description":187},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Fmath.ts#L489","docs\u002Fprimitives\u002F22.math\u002F53.fwidthfine","NvBaTmBMAugNaTuK_0ogYhQ5cCywCiKF9aWp28mKSFw",{"stars":201},6080,[203,207,211,215,219,223,227,231,235,239,243,247,251,255,259,263,267,272,276,280,284,288],{"path":204,"title":205,"description":206,"category":17},"\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":208,"title":209,"description":210,"category":17},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",{"path":212,"title":213,"description":214,"category":17},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":216,"title":217,"description":218,"category":17},"\u002Fdocs\u002Fguide\u002Fblending-masking","Blending and masking","Control how a layer mixes with the layers below it, and reveal one layer through another.",{"path":220,"title":221,"description":222,"category":17},"\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":224,"title":225,"description":226,"category":17},"\u002Fdocs\u002Fguide\u002Fanimation","Animating a shader","Tween a shader's props with Motion, GSAP or anything else that animates a number.",{"path":228,"title":229,"description":230,"category":17},"\u002Fdocs\u002Fguide\u002Fdynamic-props","Dynamic props","Drive any numeric or position prop from time, the cursor, or another layer, without writing animation code.",{"path":232,"title":233,"description":234,"category":17},"\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":236,"title":237,"description":238,"category":17},"\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":240,"title":241,"description":242,"category":17},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in any CSS unit.",{"path":244,"title":245,"description":246,"category":17},"\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":248,"title":249,"description":250,"category":17},"\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":252,"title":253,"description":254,"category":17},"\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":256,"title":257,"description":258,"category":17},"\u002Fdocs\u002Fguide\u002Fperformance","Performance","Learn what makes an effect expensive on the GPU and how to keep it inside the frame budget.",{"path":260,"title":261,"description":262,"category":17},"\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":264,"title":265,"description":266,"category":17},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":268,"title":269,"description":270,"category":271},"\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":273,"title":274,"description":275,"category":271},"\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":277,"title":278,"description":279,"category":271},"\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":281,"title":282,"description":283,"category":17},"\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":285,"title":286,"description":287,"category":17},"\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":289,"title":290,"description":291,"category":17},"\u002Fdocs\u002Fguide\u002Fssr","Server rendering","Render Shaders in Next.js, Nuxt, SvelteKit, SolidStart and other SSR apps by keeping each shader on the client.",1796051181839,"06e02370-81a6-4d74-9931-661d71414be1"]