Let shapes choose lit or flat shading, and say how a renderer that cannot drape falls back

ShapeItem.lit picks the renderer's fixed light or a flat colour; omitted,
extruded shapes and boxes are lit and the rest flat, as they were. The
Cesium draw port lights unclamped colour and image fills by it; clamped
shapes still drape unlit. A new reference scene, shapes-lit, draws a lit
and a flat box and square.

LineItem.mode now says a renderer that cannot drape at all draws draped
lines and clamped shapes as overlay, and clampState() says overlay. The
Cesium port says overlay when its context has no depth textures, which
only a WebGL 1 context can lack.
This commit is contained in:
Sameh Khamis committed 2026-11-08 13:11:25 -08:00
1 parent 8fe8b8e14d
commit e15cfb3e32
6 files changed
+87 -9

No files matched your search

+8
View File
@@ -48,6 +48,14 @@ optional, so a renderer written before it still conforms:
- A line item's `depthFailDash` (`{ length, pattern16? }`) dashes the parts
behind the surface in `depthFailColor`, as the Draw tool's rubber band is.
A renderer that predates it draws those parts solid.
- A shape's `lit` chooses shading by the renderer's fixed light (true) or a
flat colour (false); omitted, extruded shapes and boxes are lit and the
rest flat, as before. The Cesium port lights unclamped shapes only
(clamped ones drape unlit). The `shapes-lit` scene draws both.
- `SetSpec.drawOrder` stacks sets drawn over depth: a higher one draws over
a lower one and is picked first; equal ones keep the order they were
made in. The Cesium port stacks opaque icons and points by it;
translucent ones blend order-independently there.
- A rectangle shape's `rotation` (radians counter-clockwise) turns it about
its centre in longitude and latitude, as a KML ground overlay turns, and
its image fill turns with it. The Cesium port drapes image fills too, each