Lines can fade with the age of their points, drawn by the renderer on the GPU (#1892)

* Lines can fade with the age of their points, drawn by the renderer on the GPU

A LineItem's ageFade gives each position a time, a window and floors; the
renderer fades the line's alpha (and optionally its width) by each point's
recency on the scene clock, so a moving trail is not re-sent each frame.
Capability lineAgeFade; the Cesium port draws it in its line materials from a
small float texture of the points' times and a per-frame uniform, and the
conformance check draw.lines.ageFade pins it.

* Changelog for line age fade (#1892)
This commit is contained in:
Sameh Khamis authored and GitHub committed 2026-11-21 06:29:57 -08:00
1 parent 918435ddc7
commit 7ff536299a
12 files changed
+959 -46

No files matched your search

+17
View File
@@ -122,6 +122,23 @@ optional:
- A line item's `depthFail` style, solid or dashed, draws the parts behind
the surface (the Draw tool's rubber band is dashed there too); without one
they are hidden.
- `LineItem.ageFade` (capability `lineAgeFade`, `LineAgeFade`) fades a
line with the age of its points on the scene clock (`frame.setTime`):
each position has a time, a point's recency is
`1 - clamp((now - time) / windowMs, 0, 1)`, running evenly between
positions, and the line's colour (its style's or a segment's) draws at its
alpha times `mix(alphaFloor, 1, smoothstep(0, 1, recency))`, times
`mix(squaredAlphaFloor, 1, recency²)` with `squaredAlphaFloor`, and
`widthPx` times `mix(widthFloor, 1, recency)` wide with `widthFloor`. Time
passing changes the drawing, not the line, so a trail whose points stay
put is never sent again; new times with new positions are an ordinary
update. A renderer without the capability draws the line unfaded. The
Cesium port lists it where its context has floating-point textures: an
aged line's material reads its points' times from a small texture and the
scene's time from a uniform set each frame, per fragment (draped lines
along their length, others per vertex), and an undraped one moves and
recolours in place in its polyline collection. The check
`draw.lines.ageFade` covers it, draped and not, narrowed too.
- A solid line's `outline.widthPx` is the outline's whole width, half on
each side, inside the line's own width: an 8 px line with a 4 px outline
is 2 px of outline, 4 px of colour and 2 px of outline, as Cesium draws