Move geo import, voice capture, visual settings, scope mask and recent imagery onto the renderer ports

Geo import asks the frame port for renders, the camera port for moveEnd and
the globe port's progress for the terrain queue running dry; its data sources
are added, removed and shown by the listed geoImportPins module. Voice capture
waits on the frame port's postRender. Visual settings toggle the infrared fog
through the globe sky port, and the anime style dims the Milky Way through a
sky getter it is given. The scope mask reads the camera height and listens on
the frame and camera ports. Recent imagery picks the view centre, reads the
view rectangle and the field of view through the query and camera ports.
Installations claim camera sensitivity from their rendering module. The
application shell loads the unbound globe factory.
This commit is contained in:
Sameh Khamis committed 2026-11-07 18:10:39 -08:00
1 parent b19fa56565
commit 81d8e3a4a7
20 files changed
+308 -119

No files matched your search

+5 -5
View File
@@ -3,7 +3,7 @@ import {
hasStructuredViewIdentity,
} from './realtimeProtocol.js';
import { cameraPoseKey } from './pointerContext.js';
import { canvasOf } from '../render/rendererOf.js';
import { canvasOf, findFrame } from '../render/rendererOf.js';
/** The live viewer's camera pose identity (Cesium-free read). */
function readViewerCameraKey() {
@@ -230,8 +230,8 @@ export function estimateDataUrlBytes(dataUrl) {
* canvas as current. (perf wave 2)
*/
export async function renderFreshCesiumFrame(viewer) {
const scene = viewer?.scene;
if (!scene) return false;
const frame = findFrame(viewer);
if (!frame) return false;
// While the document is hidden the render loop is suspended — don't
// secretly restart rendering for an optional screenshot, and don't pass
// the stale preserved frame off as current.
@@ -241,7 +241,7 @@ export async function renderFreshCesiumFrame(viewer) {
// necessarily draw — request a frame and await its postRender (bounded),
// which also covers the just-became-visible race.
const rendered = new Promise((resolve) => {
const remove = scene.postRender.addEventListener(() => {
const remove = frame.on('postRender', () => {
remove();
resolve(true);
});
@@ -250,7 +250,7 @@ export async function renderFreshCesiumFrame(viewer) {
resolve(false);
}, 400);
});
scene.requestRender?.();
frame.requestRender('voice-capture');
const fresh = await rendered;
// A tab switch during the bounded wait invalidates freshness.
if (typeof document !== 'undefined' && document.hidden) return false;