mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 10:12:18 +00:00
Idle frame rate in the app, timed line batching, KEY REQUIRED status
Three fixes to how the globe draws and reports loading. **The idle frame rate is the app's rule.** The Cesium frame port capped the loop at `IDLE_FRAME_RATE` whenever nothing held it, so the rule lived inside the renderer. The render governor now sets the rate: the display's own while the loop is held, `IDLE_FRAME_RATE` while not. The frame port gains `onHeldChange(cb)`, which says when its first hold is taken and its last released (animated visual styles included), so the governor hears every hold. The quality setting's frame-rate cap is kept apart from the governor's rate, and the loop draws at the lower of the two, so neither overwrites the other. **Line batching is timed.** A line set waited 30 drawn frames before its unchanged lines settled into a static batch (300 for the long wait), so the batch built twice as fast at 120 Hz as at 60 Hz, and took seconds at the idle rate. It now waits `SETTLE_MS` (500 ms) and `LONG_SETTLE_MS` (5 s), and moved shapes go back into their batches on the same timing. **KEY REQUIRED.** A layer that cannot load without a provider key ended the global status chip LOAD FAILED. The chip now has a KEY REQUIRED outcome, ranked below a real failure: a layer whose stats say `keyRequired` ends KEY REQUIRED, any other failure still ends LOAD FAILED. Vessels report a missing AISStream key as `keyRequired` and name the key in the panel; a later outage clears it, as it is no longer the key that is missing. Checked: the full suite (new tests for `onHeldChange`, the quality cap against the governor's rate, timed settling, and the chip with and without a key), format, boundaries, build, the stub renderer boot and the Cesium conformance run; in the browser, the idle and held frame rates; and the first-run check now asserts that with no keys set the chip never says LOAD FAILED.
This commit is contained in:
1 parent
84d3e7b5ce
commit
0ed6cde956
33 files changed
+629
-179
No files matched your search
@@ -15,7 +15,10 @@
|
||||
* at 0. While tile detail is lowered, a tileset added later is brought
|
||||
* to it on the next drawn frame; an error is written only when it
|
||||
* changes, since each write resets the tileset's memory-adjusted error.
|
||||
* - `targetFps`: the frame port's target frame rate, 0 for none.
|
||||
* - `targetFps`: a cap on the loop's frame rate, 0 for none (`fpsCap`: by
|
||||
* default the frame port's own `setTargetFps`; the renderer's ports keep
|
||||
* it apart from the rate the application sets there, and draw at the
|
||||
* lower of the two).
|
||||
*
|
||||
* Building the port changes nothing in the scene; each setting is applied
|
||||
* when it is first set, and a detail set back to 1 hands each tileset and
|
||||
@@ -156,6 +159,10 @@ export function createCesiumQuality(
|
||||
limits = Cesium.ContextLimits,
|
||||
tickStarted = null,
|
||||
gl = webglContext(widget.scene),
|
||||
fpsCap = {
|
||||
get: () => frame.diagnostics?.().targetFps ?? 0,
|
||||
set: (fps) => frame.setTargetFps(fps),
|
||||
},
|
||||
},
|
||||
) {
|
||||
const scene = widget.scene;
|
||||
@@ -171,7 +178,7 @@ export function createCesiumQuality(
|
||||
: [];
|
||||
|
||||
// What the scene had before the port first changed it: the defaults.
|
||||
const builtFps = frame.diagnostics?.().targetFps ?? 0;
|
||||
const builtFps = fpsCap.get();
|
||||
let msaaAtBuild = null;
|
||||
let shadowsAtBuild = null;
|
||||
// Cesium clamps the count to the context's only when it is set.
|
||||
@@ -334,7 +341,7 @@ export function createCesiumQuality(
|
||||
},
|
||||
targetFps(value) {
|
||||
const fps = inRange(value, 0, MAX_FPS);
|
||||
if (fps !== null) frame.setTargetFps(fps);
|
||||
if (fps !== null) fpsCap.set(fps);
|
||||
},
|
||||
};
|
||||
|
||||
@@ -343,7 +350,7 @@ export function createCesiumQuality(
|
||||
pixelRatio,
|
||||
tiles3dDetail: detail.tiles,
|
||||
terrainDetail: detail.terrain,
|
||||
targetFps: frame.diagnostics?.().targetFps ?? 0,
|
||||
targetFps: fpsCap.get(),
|
||||
};
|
||||
if (scene.shadowMap) settings.shadows = Boolean(scene.shadowMap.enabled);
|
||||
if (msaaOptions().length > 1)
|
||||
|
||||
Reference in new issue
Block a user