[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"github-stars":3,"guide-nav":5,"doc-\u002Fdocs\u002Fprimitives\u002Fmaterials\u002Ffdcurvature":155},{"stars":4},3555,[6,12,18,22,26,30,34,38,42,46,50,54,58,62,66,71,75,79,83,88,92,96,100,104,108,112,116,120,124,127,130,134,137,141,144,148,151],{"path":7,"title":8,"description":9,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide","Getting started","Shaders is a library of GPU effect components for Vue, React, Svelte, Solid, JavaScript and Framer, with a design editor for building with them.","code",null,{"path":13,"title":14,"description":15,"category":10,"exclude":16,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",[17],"js",{"path":19,"title":20,"description":21,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":23,"title":24,"description":25,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fblending-masking","Blending and masking","Control how a layer mixes with the layers below it, and reveal one layer through another.",{"path":27,"title":28,"description":29,"category":10,"exclude":11,"forceFramework":11},"\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":31,"title":32,"description":33,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fdynamic-props","Dynamic props","Drive any numeric or position prop from time, the cursor, or another layer, without writing animation code.",{"path":35,"title":36,"description":37,"category":10,"exclude":11,"forceFramework":11},"\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":39,"title":40,"description":41,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in % or px units.",{"path":43,"title":44,"description":45,"category":10,"exclude":11,"forceFramework":11},"\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":47,"title":48,"description":49,"category":10,"exclude":11,"forceFramework":11},"\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":51,"title":52,"description":53,"category":10,"exclude":11,"forceFramework":11},"\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":55,"title":56,"description":57,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fperformance","Performance","Learn what makes an effect expensive on the GPU and how to keep it inside the frame budget.",{"path":59,"title":60,"description":61,"category":10,"exclude":11,"forceFramework":11},"\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":63,"title":64,"description":65,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":67,"title":68,"description":69,"category":70,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fmcp","Shaders MCP","Connect your AI coding agent to Shaders so it can find, install and edit effects in your codebase.","workflows",{"path":72,"title":73,"description":74,"category":70,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fcli","Shaders CLI","Install shaders and presets into your codebase as component files, and keep them in sync with the design editor.",{"path":76,"title":77,"description":78,"category":70,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fagent-skill","Agent skill","Give your coding agent a skill that teaches it to build with Shaders components, the CLI and presets.",{"path":80,"title":81,"description":82,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fvideo-rendering","Rendering to video","Turn a shader effect into a video file, from the design editor or from a frame-by-frame pipeline such as Remotion, Hyperframes or Puppeteer.",{"path":84,"title":85,"description":86,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fquick-tour-of-the-design-editor","Quick tour of the design editor","A short walkthrough of the full Shaders workflow, from designing on the infinite canvas to exporting code.","editor",{"path":89,"title":90,"description":91,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fintro-to-the-interface","Intro to the interface","A tour of the design editor interface: the canvas, layers, the Properties panel, and the ways to share and export.",{"path":93,"title":94,"description":95,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fcomposing-your-first-shader-effect","Composing your first shader effect","Building a first shader effect in the design editor by stacking and nesting components as layers.",{"path":97,"title":98,"description":99,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fmasking-and-blending","Masking and blending","How blend modes and masks combine components in the design editor.",{"path":101,"title":102,"description":103,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fdynamic-prop-mapping","Dynamic prop mapping","Turning static props into dynamic ones in the design editor: mapping one layer's output into another's prop, following the cursor, or animating automatically.",{"path":105,"title":106,"description":107,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fcustom-media-and-transformations","Custom media and transformations","Uploading images, videos, and SVG files to the media gallery, adding them to a composition, and placing them with transformations.",{"path":109,"title":110,"description":111,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Finstalling-a-shader-via-mcp","Installing a shader via MCP","Installing a shader from the design editor into a hero section with the Shaders MCP.",{"path":113,"title":114,"description":115,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fexploring-shape-effects","Exploring shape effects","Applying shape effects such as liquid glass, liquid metal, and glowing edges to built-in shapes and your own SVG.",{"path":117,"title":118,"description":119,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fglass-component-spotlight","Component spotlight: Glass","A short look at the Glass component and the liquid-glass look it creates.",{"path":121,"title":122,"description":123,"category":87,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fdigital-looks-component-spotlight","Component spotlight: Digital looks","A look at the digital stylization components for glitchy, futuristic, or technical effects.",{"path":125,"title":14,"description":126,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fjs\u002Fquickstart","Install Shaders without a framework, render your first effect on a canvas, and update props at runtime.",{"path":128,"title":14,"description":129,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Freact\u002Fquickstart","Install Shaders in a React app, render your first effect, and drive a prop from state.",{"path":131,"title":132,"description":133,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Freact\u002Fssr","Next.js and SSR","Render Shaders in Next.js and other React SSR apps by keeping each shader on the client.",{"path":135,"title":14,"description":136,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fsolid\u002Fquickstart","Install Shaders in a Solid app, render your first effect, and drive a prop from a signal.",{"path":138,"title":139,"description":140,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fsolid\u002Fssr","SolidStart and SSR","Render Shaders in SolidStart and other Solid SSR apps by keeping each shader on the client.",{"path":142,"title":14,"description":143,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fsvelte\u002Fquickstart","Install Shaders in a Svelte app, render your first effect, and drive a prop from state.",{"path":145,"title":146,"description":147,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fsvelte\u002Fssr","SvelteKit and SSR","Render Shaders in SvelteKit and other Svelte SSR apps, where each shader already waits for the browser.",{"path":149,"title":14,"description":150,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fvue\u002Fquickstart","Install Shaders in a Vue app, render your first effect, and drive a prop from a ref.",{"path":152,"title":153,"description":154,"category":10,"exclude":11,"forceFramework":11},"\u002Fdocs\u002Fguide\u002Fvue\u002Fssr","Nuxt and SSR","Render Shaders in Nuxt and other Vue SSR apps by keeping each shader on the client.",{"id":156,"title":157,"body":158,"categoryId":239,"categorySlug":239,"categoryTitle":490,"curated":491,"description":492,"editUrl":11,"extension":493,"group":494,"groupTitle":495,"kind":496,"meta":497,"navigation":498,"path":499,"seo":500,"sourceUrl":501,"stem":502,"wordCount":11,"__hash__":503},"primitives\u002Fdocs\u002Fprimitives\u002F14.materials\u002F55.fdcurvature.md","fdCurvature",{"type":159,"value":160,"toc":484},"minimark",[161,165,184,234,248,261,266,347,351,428,438,442,470,474,480],[162,163,157],"h1",{"id":164},"fdcurvature",[166,167,168,169,172,173,172,176,179,180,183],"p",{},"The value, slope and curvature of any field at a point: ",[10,170,171],{},"value",", ",[10,174,175],{},"dx",[10,177,178],{},"dy"," and ",[10,181,182],{},"curvature",".",[185,186,191],"pre",{"className":187,"code":188,"language":189,"meta":190,"style":190},"language-ts shiki shiki-themes github-dark","fdCurvature(sampleAt: (p: Expr) => Expr, p: Expr, eps: number, hint: string = 'fd'): {value: Expr; dx: Expr; dy: Expr; curvature: Expr}\n","ts","",[10,192,193],{"__ignoreMap":190},[194,195,198,201,205,208,212,215,218,221,224,227,231],"span",{"class":196,"line":197},"line",1,[194,199,157],{"class":200},"svObZ",[194,202,204],{"class":203},"s95oV","(sampleAt: (",[194,206,166],{"class":207},"s9osk",[194,209,211],{"class":210},"snl16",":",[194,213,214],{"class":200}," Expr",[194,216,217],{"class":203},") ",[194,219,220],{"class":210},"=>",[194,222,223],{"class":203}," Expr, p: Expr, eps: number, hint: string ",[194,225,226],{"class":210},"=",[194,228,230],{"class":229},"sU2Wk"," 'fd'",[194,232,233],{"class":203},"): {value: Expr; dx: Expr; dy: Expr; curvature: Expr}\n",[166,235,236,237,240,241,244,245,183],{},"Import ",[10,238,239],{},"materials"," from ",[10,242,243],{},"shaders\u002Fstd"," and use ",[10,246,247],{},"materials.fdCurvature",[166,249,250,253,254,256,257,260],{},[10,251,252],{},"fdSlope"," with two more taps. The slopes are centred, so they sit on the point rather than half a step past it, and ",[10,255,182],{}," is the field's Laplacian: negative on a crest, positive in a crease, zero on a flat or a plane. Scale it by a gain for a cavity shade that darkens creases and lifts crests. ",[10,258,259],{},"eps"," is the tap distance in the point's units.",[262,263,265],"h2",{"id":264},"parameters","Parameters",[267,268,269,285],"table",{},[270,271,272],"thead",{},[273,274,275,279,282],"tr",{},[276,277,278],"th",{},"Name",[276,280,281],{},"Type",[276,283,284],{},"Notes",[286,287,288,303,316,329],"tbody",{},[273,289,290,296,301],{},[291,292,293],"td",{},[10,294,295],{},"sampleAt",[291,297,298],{},[10,299,300],{},"(p: Expr) => Expr",[291,302],{},[273,304,305,309,314],{},[291,306,307],{},[10,308,166],{},[291,310,311],{},[10,312,313],{},"Expr",[291,315],{},[273,317,318,322,327],{},[291,319,320],{},[10,321,259],{},[291,323,324],{},[10,325,326],{},"number",[291,328],{},[273,330,331,336,341],{},[291,332,333],{},[10,334,335],{},"hint",[291,337,338],{},[10,339,340],{},"string",[291,342,343,344,183],{},"Optional. Default ",[10,345,346],{},"'fd'",[262,348,350],{"id":349},"example","Example",[185,352,354],{"className":187,"code":353,"language":189,"meta":190,"style":190},"const relief = fdCurvature(cloth, q, 0.004)\nconst cavity = clamp(sub(1, mul(relief.curvature, 0.005)), 0.6, 1.1)\n",[10,355,356,380],{"__ignoreMap":190},[194,357,358,361,365,368,371,374,377],{"class":196,"line":197},[194,359,360],{"class":210},"const",[194,362,364],{"class":363},"sDLfK"," relief",[194,366,367],{"class":210}," =",[194,369,370],{"class":200}," fdCurvature",[194,372,373],{"class":203},"(cloth, q, ",[194,375,376],{"class":363},"0.004",[194,378,379],{"class":203},")\n",[194,381,383,385,388,390,393,396,399,401,404,406,409,412,415,418,421,423,426],{"class":196,"line":382},2,[194,384,360],{"class":210},[194,386,387],{"class":363}," cavity",[194,389,367],{"class":210},[194,391,392],{"class":200}," clamp",[194,394,395],{"class":203},"(",[194,397,398],{"class":200},"sub",[194,400,395],{"class":203},[194,402,403],{"class":363},"1",[194,405,172],{"class":203},[194,407,408],{"class":200},"mul",[194,410,411],{"class":203},"(relief.curvature, ",[194,413,414],{"class":363},"0.005",[194,416,417],{"class":203},")), ",[194,419,420],{"class":363},"0.6",[194,422,172],{"class":203},[194,424,425],{"class":363},"1.1",[194,427,379],{"class":203},[429,430,431],"blockquote",{},[166,432,433,437],{},[434,435,436],"strong",{},"Tip."," Five taps of the field per pixel. Keep the field cheap.",[262,439,441],{"id":440},"see-also","See also",[443,444,445,461],"ul",{},[446,447,448,454,455,172,457,179,459,183],"li",{},[449,450,452],"a",{"href":451},"\u002Fdocs\u002Fprimitives\u002Fmaterials\u002Ffdslope",[10,453,252],{}," — The value and slope of any field at a point: ",[10,456,171],{},[10,458,175],{},[10,460,178],{},[446,462,463,469],{},[449,464,466],{"href":465},"\u002Fdocs\u002Fprimitives\u002Fmaterials\u002Fnudgenormal",[10,467,468],{},"nudgeNormal"," — Tilts a normal by a slope in x and y, turning a height field into relief.",[262,471,473],{"id":472},"used-by","Used by",[166,475,476],{},[449,477,479],{"href":478},"\u002Fdocs\u002Fcomponents\u002Fsatin","Satin",[481,482,483],"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 .s9osk, html code.shiki .s9osk{--shiki-default:#FFAB70}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}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":190,"searchDepth":382,"depth":382,"links":485},[486,487,488,489],{"id":264,"depth":382,"text":265},{"id":349,"depth":382,"text":350},{"id":440,"depth":382,"text":441},{"id":472,"depth":382,"text":473},"Materials & surfaces",false,"The value, slope and curvature of any field at a point: `value`, `dx`, `dy` and `curvature`.","md","light","Noise, light & materials","function",{},true,"\u002Fdocs\u002Fprimitives\u002Fmaterials\u002Ffdcurvature",{"title":157,"description":492},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Fpaint\u002Fmaterials.ts#L1027","docs\u002Fprimitives\u002F14.materials\u002F55.fdcurvature","ZEXLLiCbjh33DKpcARDqvMEyBmQOI2EbfocJApGCDs4"]