mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Keep globe renderers warm across live engine switches
This commit is contained in:
1 parent
f71c76c306
commit
5e658d8c9d
15 files changed
+343
-34
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user