roundedSlab
A flat shape's glass profile: a slab whose edge rounds over in a quarter circle.
roundedSlab(inside: Expr, bevel: Expr, hint: string = 'slab'): {half: Expr; slope: Expr}
Import materials from shaders/std and use materials.roundedSlab.
inside is the distance in from the shape's edge (the negated signed distance) and bevel the width of the rounded edge, both in the field's units. Returns half, half the slab's thickness here (equal to bevel across the flat middle), and slope, how steeply the surface falls away (0 on the flat, rising toward the edge, capped at 6).
Parameters
| Name | Type | Notes |
|---|---|---|
inside | Expr | |
bevel | Expr | |
hint | string | Optional. Default 'slab'. |
Example
const slab = roundedSlab(neg(field.sdf), u.bevel)
See also
throughSlab— Follow one ray through a transparent body: in through the front face, out through the back.geometricNormal— The surface normal of the shape, whichever kind of shape is active.