Moving layers redraw as fast as they move on screen, 3 to 30 times a second

Satellites, flights and vessels held the render loop at the display's rate
while they were on, so a view of slow-moving marks drew 100-170 frames a
second. Each now reads how fast its fastest mark crosses the screen and asks
for a frame whenever that mark would move half a pixel: never fewer than 3 a
second (animated marks never stall), never more than 30 (room in the frame
for the rest of the scene). Below 12 a second the layer asks for one frame at
a time on a timer; from there it holds the loop at 15, 20 or 30, rates the
display divides evenly (renderPace.js).

The render governor takes a rate per hold: the highest asked wins, a hold
with no rate draws at the display's rate. Following a target is capped at
30. Steering the camera (a drag, a pinch, the wheel) still draws at the
display's rate; it ends when the last pointer lifts, the wheel rests, or the
page loses focus or is hidden.

Draw sets whose motion clock is the owner's ('frames: owner') ask for no
frames for moving rows or for rows written in place; the owner's pace does.
The vessels layer places its contacts at most 30 times a second and writes
every move of a pass to its icons in one batch.

Measured in Chrome on a still camera (draws a second, before -> after):
satellites over the whole globe 162 -> 6, at 1,500 km 114 -> 30; flights over
the whole globe 132 -> 10, Europe 53 -> 5, London 114 -> 9. Planes move at
most 0.6 px between draws.
This commit is contained in:
Sameh Khamis committed 2026-11-23 18:56:44 -08:00
1 parent 43bd25382d
commit d50f04efeb
30 files changed
+1262 -82

No files matched your search

+9 -3
View File
@@ -796,16 +796,20 @@ export function createCesiumDraw({
setsVersion += 1;
};
record.rebuild = rebuild;
// A set whose owner asks for its frames is changed in place without
// asking for one: the owner writes it as a frame begins (asking then
// would draw that frame twice), or its next frame draws the change.
const ownerFrames = () => spec.motionClock?.frames === 'owner';
// Changed in place: what height queries see through may have changed.
const patched = () => {
setsVersion += 1;
requestRender();
if (!ownerFrames()) requestRender();
};
// Icons changed in place: height queries see through the sets' pick
// ids, which an icon keeps, so only icons added or gone change them.
const iconsPatched = (synced) => {
if (synced === ICONS_CHANGED) setsVersion += 1;
requestRender();
if (!ownerFrames()) requestRender();
};
// A shape's pulse the renderer cannot run is refused before anything
// changes.
@@ -925,7 +929,9 @@ export function createCesiumDraw({
spec.motionClock?.kind === 'live'
) {
spec.motionClock = options.motionClock;
requestRender();
// A set whose owner asks for its frames reads the new delay in
// the owner's next one: the delay alone asks for none.
if (options.motionClock.frames !== 'owner') requestRender();
return;
}
// Refused, changing nothing, where icons on the GPU cannot take it