[{"data":1,"prerenderedAt":344,"buildId":345},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fprimitives\u002Fmaterials\u002Froundedslab":3,"github-stars":252,"guide-nav":254},{"id":4,"title":5,"body":6,"categoryId":55,"categorySlug":55,"categoryTitle":238,"curated":239,"description":16,"editUrl":240,"extension":241,"group":242,"groupTitle":243,"kind":244,"meta":245,"navigation":246,"path":247,"seo":248,"sourceUrl":249,"stem":250,"wordCount":240,"__hash__":251},"primitives\u002Fdocs\u002Fprimitives\u002F14.materials\u002F58.roundedslab.md","roundedSlab",{"type":7,"value":8,"toc":231},"minimark",[9,13,17,50,65,86,91,157,161,190,194,217,221,227],[10,11,5],"h1",{"id":12},"roundedslab",[14,15,16],"p",{},"A flat shape's glass profile: a slab whose edge rounds over in a quarter circle.",[18,19,24],"pre",{"className":20,"code":21,"language":22,"meta":23,"style":23},"language-ts shiki shiki-themes github-dark","roundedSlab(inside: Expr, bevel: Expr, hint: string = 'slab'): {half: Expr; slope: Expr}\n","ts","",[25,26,27],"code",{"__ignoreMap":23},[28,29,32,35,39,43,47],"span",{"class":30,"line":31},"line",1,[28,33,5],{"class":34},"svObZ",[28,36,38],{"class":37},"s95oV","(inside: Expr, bevel: Expr, hint: string ",[28,40,42],{"class":41},"snl16","=",[28,44,46],{"class":45},"sU2Wk"," 'slab'",[28,48,49],{"class":37},"): {half: Expr; slope: Expr}\n",[14,51,52,53,56,57,60,61,64],{},"Import ",[25,54,55],{},"materials"," from ",[25,58,59],{},"shaders\u002Fstd"," and use ",[25,62,63],{},"materials.roundedSlab",".",[14,66,67,70,71,74,75,78,79,81,82,85],{},[25,68,69],{},"inside"," is the distance in from the shape's edge (the negated signed distance) and ",[25,72,73],{},"bevel"," the width of the rounded edge, both in the field's units. Returns ",[25,76,77],{},"half",", half the slab's thickness here (equal to ",[25,80,73],{}," across the flat middle), and ",[25,83,84],{},"slope",", how steeply the surface falls away (0 on the flat, rising toward the edge, capped at 6).",[87,88,90],"h2",{"id":89},"parameters","Parameters",[92,93,94,110],"table",{},[95,96,97],"thead",{},[98,99,100,104,107],"tr",{},[101,102,103],"th",{},"Name",[101,105,106],{},"Type",[101,108,109],{},"Notes",[111,112,113,127,139],"tbody",{},[98,114,115,120,125],{},[116,117,118],"td",{},[25,119,69],{},[116,121,122],{},[25,123,124],{},"Expr",[116,126],{},[98,128,129,133,137],{},[116,130,131],{},[25,132,73],{},[116,134,135],{},[25,136,124],{},[116,138],{},[98,140,141,146,151],{},[116,142,143],{},[25,144,145],{},"hint",[116,147,148],{},[25,149,150],{},"string",[116,152,153,154,64],{},"Optional. Default ",[25,155,156],{},"'slab'",[87,158,160],{"id":159},"example","Example",[18,162,164],{"className":20,"code":163,"language":22,"meta":23,"style":23},"const slab = roundedSlab(neg(field.sdf), u.bevel)\n",[25,165,166],{"__ignoreMap":23},[28,167,168,171,175,178,181,184,187],{"class":30,"line":31},[28,169,170],{"class":41},"const",[28,172,174],{"class":173},"sDLfK"," slab",[28,176,177],{"class":41}," =",[28,179,180],{"class":34}," roundedSlab",[28,182,183],{"class":37},"(",[28,185,186],{"class":34},"neg",[28,188,189],{"class":37},"(field.sdf), u.bevel)\n",[87,191,193],{"id":192},"see-also","See also",[195,196,197,208],"ul",{},[198,199,200,207],"li",{},[201,202,204],"a",{"href":203},"\u002Fdocs\u002Fprimitives\u002Fmaterials\u002Fthroughslab",[25,205,206],{},"throughSlab"," — Follow one ray through a transparent body: in through the front face, out through the back.",[198,209,210,216],{},[201,211,213],{"href":212},"\u002Fdocs\u002Fprimitives\u002Fmaterials\u002Fgeometricnormal",[25,214,215],{},"geometricNormal"," — The surface normal of the shape, whichever kind of shape is active.",[87,218,220],{"id":219},"used-by","Used by",[14,222,223],{},[201,224,226],{"href":225},"\u002Fdocs\u002Fcomponents\u002Fprismaticglass","PrismaticGlass",[228,229,230],"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 .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":23,"searchDepth":232,"depth":232,"links":233},2,[234,235,236,237],{"id":89,"depth":232,"text":90},{"id":159,"depth":232,"text":160},{"id":192,"depth":232,"text":193},{"id":219,"depth":232,"text":220},"Materials & surfaces",false,null,"md","light","Noise, light & materials","function",{},true,"\u002Fdocs\u002Fprimitives\u002Fmaterials\u002Froundedslab",{"title":5,"description":16},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Fpaint\u002Fmaterials.ts#L1409","docs\u002Fprimitives\u002F14.materials\u002F58.roundedslab","TOx2RQizkaiT3R0hw7hl5H0DMCY8fgW9dPjclVkSW2M",{"stars":253},6080,[255,259,263,267,271,275,279,283,287,291,295,299,303,307,311,315,319,324,328,332,336,340],{"path":256,"title":257,"description":258,"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":260,"title":261,"description":262,"category":25},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",{"path":264,"title":265,"description":266,"category":25},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":268,"title":269,"description":270,"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":272,"title":273,"description":274,"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":276,"title":277,"description":278,"category":25},"\u002Fdocs\u002Fguide\u002Fanimation","Animating a shader","Tween a shader's props with Motion, GSAP or anything else that animates a number.",{"path":280,"title":281,"description":282,"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":284,"title":285,"description":286,"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":288,"title":289,"description":290,"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":292,"title":293,"description":294,"category":25},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in any CSS unit.",{"path":296,"title":297,"description":298,"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":300,"title":301,"description":302,"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":304,"title":305,"description":306,"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":308,"title":309,"description":310,"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":312,"title":313,"description":314,"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":316,"title":317,"description":318,"category":25},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":320,"title":321,"description":322,"category":323},"\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":325,"title":326,"description":327,"category":323},"\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":329,"title":330,"description":331,"category":323},"\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":333,"title":334,"description":335,"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":337,"title":338,"description":339,"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":341,"title":342,"description":343,"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.",1796051178760,"06e02370-81a6-4d74-9931-661d71414be1"]