Keep globe renderers warm across live engine switches

This commit is contained in:
German Khokhlov committed 2026-11-02 13:45:23 +04:00
1 parent f71c76c306
commit 5e658d8c9d
15 files changed
+343 -34

No files matched your search

+2
View File
@@ -16,6 +16,7 @@ import {
forEachLuminanceUniform,
keepCascadedLightIds,
navaraHooks,
setRenderLoopEnabled,
} from './internals.js';
import { buildNavaraLook } from './look.js';
import { createNavaraSharpen } from './sharpen.js';
@@ -201,6 +202,7 @@ export async function createNavaraGlobe({
NavaraEffect,
DrapedMesh,
setupMaterialForDrape,
setRenderLoop: (enabled) => setRenderLoopEnabled(view, enabled),
destroy() {
if (destroyed) return;
destroyed = true;
+8
View File
@@ -9,6 +9,14 @@ import { patchCascadedLightCopy } from './cascadedLightCopy.js';
export const NAVARA_INTERNALS_VERSION = '0.2.1';
// Navara 0.2.1's animation=false still updates the tile tree every RAF.
// Until ThreeView exposes suspend/resume, stop its underlying Three loop
// while this view is parked and reinstall its normal loop when it returns.
export function setRenderLoopEnabled(view, enabled) {
if (enabled) view._startMainLoop();
else view._renderer.setAnimationLoop(null);
}
let restoreRelease = null;
/**