render: hold continuous render while the world clock plays away from live

Playback moves something every frame, so it draws at the display's rate
rather than the parked scene's 60 FPS cap. followWorldTime reports when the
clock starts and stops playing (not live, not stepped, not waiting for data).
This commit is contained in:
Sameh Khamis committed 2026-11-15 13:35:11 -08:00
1 parent cb3be34283
commit 8af8c086a6
3 files changed
+90 -4

No files matched your search

+8
View File
@@ -13,6 +13,8 @@ import { initLogoGaze } from '../logoGaze.js';
import {
uninstallRenderGovernor,
governorRequestRender,
holdContinuousRender,
releaseContinuousRender,
} from '../renderGovernor.js';
import { describeError } from './errors.js';
import { isEmbeddedInline } from './embed.js';
@@ -73,6 +75,12 @@ export async function createApplicationScene({
followWorldTime(viewer, worldTimeFor('sky'), {
subscribe: worldClock.subscribe,
requestRender: () => governorRequestRender('world-time'),
// A playing world time moves something every frame: draw at the
// display's rate meanwhile, not the parked scene's cap.
onPlaying: (playing) =>
playing
? holdContinuousRender('world-time')
: releaseContinuousRender('world-time'),
}),
);
defer(installFreeLookHeightLimit(viewer));