mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-24 04:02:19 +00:00
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:
1 parent
43bd25382d
commit
d50f04efeb
30 files changed
+1262
-82
No files matched your search
@@ -6618,6 +6618,26 @@ fn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {
|
||||
deepEqual(heard, [true, false], 'nothing once off');
|
||||
},
|
||||
),
|
||||
check(
|
||||
'frame.onHoldsChange',
|
||||
'onHoldsChange is told every hold and release, whoever holds, and nothing once off',
|
||||
(h, r) => {
|
||||
let heard = 0;
|
||||
const off = r.frame.onHoldsChange(() => (heard += 1));
|
||||
try {
|
||||
const one = r.frame.holdContinuous('conformance:one');
|
||||
const two = r.frame.holdContinuous('conformance:two');
|
||||
one();
|
||||
two();
|
||||
equal(heard, 4, 'two holds and two releases');
|
||||
} finally {
|
||||
off();
|
||||
}
|
||||
r.frame.holdContinuous('conformance:after')();
|
||||
equal(heard, 4, 'nothing once off');
|
||||
},
|
||||
{ capability: 'holdChanges' },
|
||||
),
|
||||
check(
|
||||
'frame.setTargetFps',
|
||||
'setTargetFps caps the loop; diagnostics say the cap, 0 the display rate',
|
||||
|
||||
Reference in new issue
Block a user