You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/src/content/docs/components/poly-scene.mdx
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ The React/Vue components and `createPolyScene()` support the full table. The `<p
26
26
|`strategies`|`{ disable?: ("b" \| "i" \| "u")[] }`| None | Diagnostic override for render strategy selection. Disabled solid strategies fall through to `<s>` atlas slices; `<s>` cannot be disabled. |
27
27
|`autoCenter`|`boolean`|`false`| Rotate around the content bbox center instead of world origin. Polygon data is not mutated. |
28
28
|`centerPolygons`|`Polygon[]`| None | (Framework only.) Bbox source for `autoCenter` when renderable polygons live inside child meshes. |
29
-
|`shadow`|`{ color?, opacity?, lift?, maxExtend?}`|`{ color:"#000000", opacity:0.25, lift:0.05, maxExtend:2000 }`| Appearance and SVG extent cap for cast shadows emitted by meshes with `castShadow`. |
29
+
|`shadow`|`{ color?, opacity?, lift?, maxExtend?, parametric?, definition?, style?, dragDefinition?, followAnimation? }`|`{ color:"#000000", opacity:0.25, lift:0.05, maxExtend:2000 }`| Appearance + SVG extent cap for cast shadows. `parametric` swaps to a cheap low-res silhouette (`definition` = detail, `style: "vector" \| "pixel"`); `dragDefinition` (vanilla) and `followAnimation` cover light-drag and animated meshes. See [Parametric shadows](/guides/lighting/#parametric-shadows). |
30
30
|`polygons`|`Polygon[]`| None | (Framework only.) Flat array of polygon objects rendered as direct children. Composes with JSX/slot children. |
Copy file name to clipboardExpand all lines: website/src/content/docs/guides/lighting.mdx
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -175,6 +175,31 @@ What to expect:
175
175
-**Colored multi-light shadows.** Each light's shadow is filled with the receiver lit by every *other* light, so a spot blocked from one colored light still shows the others' color. Where two shadows overlap, the region composites to the both-blocked color (ambient only) — not a doubled-up black smear.
176
176
-**`shadow.lift`** floats the shadow a hair above the receiver to avoid z-fighting; the default is fine, just don't set it to exactly `0` on a coplanar floor.
177
177
178
+
## Parametric shadows
179
+
180
+
By default a shadow projects every casting polygon. Set `shadow: { parametric: true }` and PolyCSS instead casts one low-resolution **coverage silhouette** per caster — far fewer DOM/SVG vertices and a cheaper projection, at the cost of an approximate (but concave- and hole-aware) outline. The exact path stays the default; parametric is purely opt-in and works in all three renderers.
-**`definition`** (default `16`) — silhouette detail. Higher → closer to the exact outline and sharper holes, but more vertices. Override it per mesh with **`shadowDefinition`** (`PolyMeshTransform.shadowDefinition` in vanilla, `<PolyMesh shadowDefinition>` in React, `shadow-definition` in Vue) so a detailed hero caster stays crisp while simple props run cheap in the same scene.
198
+
-**`style: "vector" | "pixel"`** — `"vector"` (default) traces a smooth concave contour; `"pixel"` greedy-meshes the coverage into blocky **voxel** rectangles, where `definition` becomes the pixel-grid resolution (lower → chunkier). Holes (courtyards, an arena) come through in both.
199
+
-**Point lights** are supported — each casting point light gets its own radial silhouette.
200
+
-**`dragDefinition`***(vanilla `createPolyScene` only)* — progressive refinement. While the directional light is being dragged the shadow renders at this lower definition for a smooth drag, then a debounced pass re-emits at full `definition` once the light settles. React/Vue get the same effect by lowering `definition` in component state during a drag.
201
+
-**`followAnimation`** — by default a deforming/animated caster's shadow **freezes** at the last pose (re-projecting it every frame is expensive). Set `followAnimation: true` to make the shadow track the animation; pair it with `parametric` + a modest `definition` so the per-frame reprojection stays cheap.
202
+
178
203
## Live & animated lights
179
204
180
205
-**Animating the directional light:** use **dynamic** mode — moving the light is a single CSS-variable write per frame, no JS in the paint loop, and shadows re-project automatically.
0 commit comments