Shape / SDF Effects
Several components — such as Glass, Neon, and Emboss — are driven by a shape. These effects accept a shape prop that describes which shape to use and how it should be configured. They use what is called an "SDF" (or "signed distance field") texture to render the shape. An SDF is a mathematical representation of a shape that determines the distance from any pixel to the shape's boundary.
The result is a stunning physically based effect that wraps around a particular shape, including your own SVG logo or icon.
Shapes come in two flavours: flat 2D profiles (circles, stars, rounded rectangles, …) and true 3D primitives (spheres, cubes, toruses, …) that are raymarched into the field, so effects like Glass and Crystal refract through real volume and curvature. You can also extrude your own SVG into a solid 3D slab.
Configuration
The shape prop accepts a configuration object. The only required key is type, which selects one of the built-in shapes, like circleSDF or sphere3D. Everything else is shape-specific and optional (sensible defaults apply).
2D shapes
These are flat profiles defined directly in the field. All sizes are in UV space (roughly 0–0.5 from the centre to an edge), and rotations are in degrees.
Circle — circleSDF
A perfect circle. The default shape for all shape effects.
| Prop | Type | Default | Description |
|---|---|---|---|
radius | number | 0.35 | Circle radius in UV space |
{ "type": "circleSDF", "radius": 0.35 }
Ellipse — ellipseSDF
A stretched circle with independent horizontal and vertical radii.
| Prop | Type | Default | Description |
|---|---|---|---|
width | number | 0.4 | Horizontal radius (semi-major axis) |
height | number | 0.25 | Vertical radius (semi-minor axis) |
rotation | number | 0 | Rotation in degrees |
{ "type": "ellipseSDF", "width": 0.4, "height": 0.25, "rotation": 0 }
Polygon — polygonSDF
A regular N-sided polygon (triangle, square, hexagon, etc.).
| Prop | Type | Default | Description |
|---|---|---|---|
radius | number | 0.35 | Distance from center to nearest edge midpoint |
sides | number | 6 | Number of sides |
rounding | number | 0 | Corner rounding amount |
rotation | number | 0 | Rotation in degrees |
{ "type": "polygonSDF", "radius": 0.3, "sides": 6, "rounding": 0.05, "rotation": 0 }
Star — starSDF
An N-pointed star with configurable inner/outer radius ratio.
| Prop | Type | Default | Description |
|---|---|---|---|
radius | number | 0.35 | Outer tip radius |
sides | number | 5 | Number of points |
innerRatio | number | 0.382 | Inner vertex radius as a fraction of outer radius — 0.382 gives the classic golden-ratio 5-star |
rotation | number | 0 | Rotation in degrees |
{ "type": "starSDF", "radius": 0.35, "sides": 5, "innerRatio": 0.382, "rotation": 0 }
Flower — flowerSDF
An N-petalled flower with smooth concave valleys between petals.
| Prop | Type | Default | Description |
|---|---|---|---|
radius | number | 0.35 | Outer petal tip radius |
sides | number | 6 | Number of petals |
innerRatio | number | 0.5 | Valley depth — 0.2 = deep narrow valleys, 0.8 = subtle scalloped edge |
rotation | number | 0 | Rotation in degrees |
{ "type": "flowerSDF", "radius": 0.35, "sides": 6, "innerRatio": 0.5, "rotation": 0 }
Ring — ringSDF
A hollow ring / annulus. The effect applies to the ring material itself, not the interior hole.
| Prop | Type | Default | Description |
|---|---|---|---|
radius | number | 0.3 | Distance from center to the ring centerline |
thickness | number | 0.08 | Half-width of the ring on each side of the centerline |
{ "type": "ringSDF", "radius": 0.3, "thickness": 0.08 }
Cross — crossSDF
A plus-sign cross with configurable arm length, thickness, and corner rounding.
| Prop | Type | Default | Description |
|---|---|---|---|
size | number | 0.25 | Arm half-length |
thickness | number | 0.08 | Arm half-width |
rounding | number | 0.02 | Corner rounding at arm ends and intersections |
rotation | number | 0 | Rotation in degrees — use 45 for an X shape |
{ "type": "crossSDF", "size": 0.25, "thickness": 0.08, "rounding": 0.02, "rotation": 0 }
Rounded Rectangle — roundedRectSDF
A rectangle with uniformly rounded corners.
| Prop | Type | Default | Description |
|---|---|---|---|
width | number | 0.35 | Half-width |
height | number | 0.25 | Half-height |
rounding | number | 0.05 | Corner rounding radius |
rotation | number | 0 | Rotation in degrees |
{ "type": "roundedRectSDF", "width": 0.35, "height": 0.25, "rounding": 0.05, "rotation": 0 }
Vesica — vesicaSDF
A lens / eye shape formed by the intersection of two overlapping circles.
| Prop | Type | Default | Description |
|---|---|---|---|
radius | number | 0.35 | Radius of each circle |
spread | number | 0.5 | Half-distance between circle centers as a fraction of radius — 0 = a single circle, 1 = an infinitely thin lens |
rotation | number | 0 | Rotation in degrees |
{ "type": "vesicaSDF", "radius": 0.35, "spread": 0.5, "rotation": 0 }
Crescent — crescentSDF
A crescent / moon shape formed by subtracting a smaller offset circle from a larger one.
| Prop | Type | Default | Description |
|---|---|---|---|
radius | number | 0.35 | Outer circle radius |
innerRatio | number | 0.75 | Inner circle radius as a fraction of outer — larger values produce a thinner crescent |
offset | number | 0.15 | Horizontal distance between the two circle centers — controls how much the inner circle overlaps |
rotation | number | 0 | Rotation in degrees |
{ "type": "crescentSDF", "radius": 0.35, "innerRatio": 0.75, "offset": 0.15, "rotation": 0 }
Trapezoid — trapezoidSDF
A quadrilateral with parallel top and bottom edges of different widths.
| Prop | Type | Default | Description |
|---|---|---|---|
bottomWidth | number | 0.35 | Bottom edge half-width |
topWidth | number | 0.2 | Top edge half-width |
height | number | 0.25 | Half-height |
rotation | number | 0 | Rotation in degrees |
{ "type": "trapezoidSDF", "bottomWidth": 0.35, "topWidth": 0.2, "height": 0.25, "rotation": 0 }
3D shapes
3D shapes are true volumetric primitives — they are raymarched into the field rather than drawn as a flat silhouette. Effects that support volume (Glass, Neon, Emboss, ThinFilm, and Crystal) use this to refract, shade, and crease according to the real surface, giving you a physically based 3D object lit inside your design. (SmokeFill treats every shape as a flat fill.)
Every 3D shape is positioned with three independent rotations — rotX, rotY, and rotZ — given in degrees. All sizes are in UV space.
Rotation order: 3D rotations don't commute — the order they're combined in changes the result. Shaders applies them as a fixed Euler sequence: Y first, then X, then Z. Because the sequence is fixed, the order you list the props in the config has no effect — only the angle values matter. If a combination of angles doesn't land the way you expect, adjust the values rather than trying to reorder them. As a rough mental model,
rotYis a turntable spin (left/right),rotXtips the shape toward or away from you, androtZrolls it in the screen plane.
Tip: The size and rotation sub-props of a 3D shape can each be a dynamic prop instead of a number. Set a rotation to an
auto-animateconfig looping from-180to180for a continuous spin, with no animation code:{ "type": "torus3D", "radius": 0.3, "tube": 0.12, "rotY": { "type": "auto-animate", "mode": "loop", "outputMin": -180, "outputMax": 180, "speed": 0.5 } }
Sphere — sphere3D
A perfect sphere.
| Prop | Type | Default | Description |
|---|---|---|---|
radius | number | 0.35 | Sphere radius |
rotX rotY rotZ | number | 0 | Rotation around each axis, in degrees |
{ "type": "sphere3D", "radius": 0.35, "rotX": 0, "rotY": 0, "rotZ": 0 }
Cube — cube3D
A box with independent dimensions and rounded edges.
| Prop | Type | Default | Description |
|---|---|---|---|
sizeX | number | 0.27 | Half-width (X) |
sizeY | number | 0.27 | Half-height (Y) |
sizeZ | number | 0.27 | Half-depth (Z) |
rounding | number | 0.02 | Edge/corner rounding |
rotX rotY rotZ | number | 25 / 35 / 0 | Rotation around each axis, in degrees |
{ "type": "cube3D", "sizeX": 0.27, "sizeY": 0.27, "sizeZ": 0.27, "rounding": 0.02, "rotX": 25, "rotY": 35, "rotZ": 0 }
Torus — torus3D
A doughnut ring.
| Prop | Type | Default | Description |
|---|---|---|---|
radius | number | 0.3 | Ring radius (centre to tube centreline) |
tube | number | 0.12 | Tube radius |
rotX rotY rotZ | number | 55 / 0 / 0 | Rotation around each axis, in degrees |
{ "type": "torus3D", "radius": 0.3, "tube": 0.12, "rotX": 55, "rotY": 0, "rotZ": 0 }
Octahedron — octahedron3D
An eight-faced diamond/bipyramid.
| Prop | Type | Default | Description |
|---|---|---|---|
radius | number | 0.42 | Distance from centre to each vertex |
rotX rotY rotZ | number | 10 / 25 / 0 | Rotation around each axis, in degrees |
{ "type": "octahedron3D", "radius": 0.42, "rotX": 10, "rotY": 25, "rotZ": 0 }
Cylinder — cylinder3D
A capped cylinder with rounded edges.
| Prop | Type | Default | Description |
|---|---|---|---|
radius | number | 0.22 | Cylinder radius |
height | number | 0.26 | Half-height |
rounding | number | 0.02 | Edge rounding |
rotX rotY rotZ | number | 60 / 0 / 30 | Rotation around each axis, in degrees |
{ "type": "cylinder3D", "radius": 0.22, "height": 0.26, "rounding": 0.02, "rotX": 60, "rotY": 0, "rotZ": 30 }
Capsule — capsule3D
A cylinder with hemispherical caps (a pill).
| Prop | Type | Default | Description |
|---|---|---|---|
radius | number | 0.16 | Capsule radius |
height | number | 0.2 | Half-length of the straight section |
rotX rotY rotZ | number | 0 / 0 / 35 | Rotation around each axis, in degrees |
{ "type": "capsule3D", "radius": 0.16, "height": 0.2, "rotX": 0, "rotY": 0, "rotZ": 35 }
Cone — cone3D
A cone or truncated cone. Set topRadius above 0 to flatten the tip into a frustum.
| Prop | Type | Default | Description |
|---|---|---|---|
radius | number | 0.3 | Base radius |
topRadius | number | 0.02 | Top radius — 0 for a sharp point |
height | number | 0.3 | Half-height |
rotX rotY rotZ | number | 25 / 0 / 15 | Rotation around each axis, in degrees |
{ "type": "cone3D", "radius": 0.3, "topRadius": 0.02, "height": 0.3, "rotX": 25, "rotY": 0, "rotZ": 15 }
Pyramid — pyramid3D
A square-based pyramid.
| Prop | Type | Default | Description |
|---|---|---|---|
size | number | 0.3 | Base half-width |
height | number | 0.45 | Apex height |
rotX rotY rotZ | number | -10 / 30 / 0 | Rotation around each axis, in degrees |
{ "type": "pyramid3D", "size": 0.3, "height": 0.45, "rotX": -10, "rotY": 30, "rotZ": 0 }
Prism — prism3D
A hexagonal prism.
| Prop | Type | Default | Description |
|---|---|---|---|
radius | number | 0.28 | Hexagon radius |
height | number | 0.14 | Half-depth of the prism |
rotX rotY rotZ | number | 25 / 30 / 0 | Rotation around each axis, in degrees |
{ "type": "prism3D", "radius": 0.28, "height": 0.14, "rotX": 25, "rotY": 30, "rotZ": 0 }
Ellipsoid — ellipsoid3D
A sphere with three independent radii.
| Prop | Type | Default | Description |
|---|---|---|---|
radiusX | number | 0.38 | Radius along X |
radiusY | number | 0.22 | Radius along Y |
radiusZ | number | 0.3 | Radius along Z |
rotX rotY rotZ | number | 0 / 0 / 20 | Rotation around each axis, in degrees |
{ "type": "ellipsoid3D", "radiusX": 0.38, "radiusY": 0.22, "radiusZ": 0.3, "rotX": 0, "rotY": 0, "rotZ": 20 }
Diamond — diamond3D
A faceted gemstone with a crown and pavilion — the showpiece shape for the Crystal effect.
| Prop | Type | Default | Description |
|---|---|---|---|
radius | number | 0.3 | Girdle radius |
height | number | 0.42 | Total height (crown + pavilion) |
rotX rotY rotZ | number | 15 / 0 / 0 | Rotation around each axis, in degrees |
{ "type": "diamond3D", "radius": 0.3, "height": 0.42, "rotX": 15, "rotY": 0, "rotZ": 0 }
Link — link3D
A rounded chain link.
| Prop | Type | Default | Description |
|---|---|---|---|
radius | number | 0.18 | Inner radius of the link's curve |
length | number | 0.15 | Half-length of the straight section |
tube | number | 0.08 | Tube radius |
rotX rotY rotZ | number | 20 / 30 / 0 | Rotation around each axis, in degrees |
{ "type": "link3D", "radius": 0.18, "length": 0.15, "tube": 0.08, "rotX": 20, "rotY": 30, "rotZ": 0 }
Custom shapes
For getting creative with custom shapes like your product logo or icon, you can supply an SDF (signed distance) field texture.
To use an SVG shape, set shapeSdfUrl to the URL of an SDF .bin file. The easiest way to get one is the design editor — upload your SVG there, and the code export includes a ready-to-use hosted .bin URL. If you work with the Shaders MCP, your agent can also generate an SDF from any SVG in your project.
Extruding a custom SVG into 3D
Custom SVGs aren't limited to flat profiles — they can be extruded into a solid 3D slab with rounded bevels, so volumetric effects (Glass, Neon, Emboss, ThinFilm, Crystal) wrap around your logo as a real object. Alongside shapeSdfUrl, set the shape config type to svgExtrude3D and tune the extrusion:
| Prop | Type | Default | Description |
|---|---|---|---|
depth | number | 0.12 | Total thickness of the slab along the view axis |
bevel | number | 0.02 | Rounded-edge radius on the extruded sides |
rotX rotY rotZ | number | 15 / 30 / 0 | Rotation around each axis, in degrees |
As with the analytic 3D shapes, these sub-props accept dynamic prop configs (e.g. an auto-animate rotation for a spinning logo).
The easiest way to produce a working extruded logo (SDF .bin plus the matching shape config) is to set it up visually in the design editor and use the code export.