mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 08:42:21 +00:00
Add raster imagery to the globe contract and draw FIRMS heat and Recent Imagery through it
engine.imagery draws raster layers over the globe: Web Mercator tile templates and single images or canvases stretched over a rectangle, with alpha, show, a left/right split against the engine's split position and an order. A layer's source can be replaced in place. - Cesium puts one ImageryLayer per layer on the globe's imagery stack, or on the shown 3D tileset's when the globe is hidden, and moves it when the surface changes; the Recent Imagery request gate moved here. - Navara draws them in one screen pass after tone mapping that samples up to eight layers by geodetic position from mipmapped textures and a tile atlas, under the other drapes and engine.ground. - The fake engine keeps each layer's state. The FIRMS far-zoom heat raster and Recent Imagery now draw through it, so FIRMS' heat seam and both its backends, and Recent Imagery's Cesium and Navara renderers and tile plan, go. Against HEAD, Cesium's pixels are identical in all four compared scenes; Navara's orbital heat changes by a mean of 3.8 from new mipmapping, slightly towards Cesium. The contract suite passes on both engines (Cesium 68/68, Navara 71/71). engine.maps.addOverlay stays a Navara-only extension for Sea Marks and Ski Pistes until imagery has a finer tile path for oblique global views.
This commit is contained in:
1 parent
1559bd57f4
commit
406dd9122e
52 files changed
+4171
-1988
No files matched your search
@@ -50,6 +50,7 @@ import {
|
||||
viewRectangle,
|
||||
} from '../cameraMath.js';
|
||||
import { createGroundPicks, createGroundRegistry } from '../ground.js';
|
||||
import { createImageryRegistry } from '../imagery.js';
|
||||
import { createLineRegistry } from '../lines.js';
|
||||
import { createMoverRegistry } from '../movers.js';
|
||||
import { createCpuPicker } from '../cpuPicks.js';
|
||||
@@ -268,6 +269,27 @@ export function createFakeEngine(options = {}) {
|
||||
},
|
||||
destroy() {},
|
||||
}));
|
||||
// Imagery layers keep their state for tests; every change is a render
|
||||
// request. They drape on the globe, or on tiles while photoreal shows.
|
||||
const imageryRegistry = createImageryRegistry(
|
||||
() => ({
|
||||
source() {
|
||||
fake.renderRequests++;
|
||||
},
|
||||
look() {
|
||||
fake.renderRequests++;
|
||||
},
|
||||
destroy() {
|
||||
fake.renderRequests++;
|
||||
},
|
||||
}),
|
||||
{
|
||||
splitPosition() {
|
||||
fake.renderRequests++;
|
||||
},
|
||||
surface: () => (fake.maps.photoreal != null ? 'tiles' : 'globe'),
|
||||
},
|
||||
);
|
||||
const inputs = new Map(INPUT_TYPES.map((type) => [type, new Set()]));
|
||||
const livePosition = cartesian3.create();
|
||||
let lastBaseImagery = null;
|
||||
@@ -664,6 +686,7 @@ export function createFakeEngine(options = {}) {
|
||||
movers: moverRegistry.movers,
|
||||
lines: lineRegistry.lines,
|
||||
ground: groundRegistry.ground,
|
||||
imagery: imageryRegistry.imagery,
|
||||
clock: {
|
||||
now: () => appClock.now(),
|
||||
frameTime: () => appClock.frameTime(),
|
||||
@@ -802,6 +825,7 @@ export function createFakeEngine(options = {}) {
|
||||
moverRegistry.destroyAll();
|
||||
lineRegistry.destroyAll();
|
||||
groundRegistry.destroyAll();
|
||||
imageryRegistry.destroyAll();
|
||||
fake.destroyed = true;
|
||||
},
|
||||
isDestroyed: () => fake.destroyed,
|
||||
@@ -889,6 +913,24 @@ export function createFakeEngine(options = {}) {
|
||||
}
|
||||
: undefined;
|
||||
},
|
||||
/**
|
||||
* A live imagery layer's state, by id: { options, source, alpha, shown,
|
||||
* split }; `layers()` all of them in draw order.
|
||||
*/
|
||||
imageryLayer(id) {
|
||||
const state = imageryRegistry.live.get(id);
|
||||
return state
|
||||
? {
|
||||
options: state.options,
|
||||
source: state.source,
|
||||
alpha: state.alpha,
|
||||
shown: state.shown,
|
||||
split: state.split,
|
||||
}
|
||||
: undefined;
|
||||
},
|
||||
imageryLayers: () =>
|
||||
imageryRegistry.ordered().map(({ options }) => options.id),
|
||||
/** The app clock the engine clock reads (freeze/offset/rate for tests). */
|
||||
appClock,
|
||||
/** Moves the fake wall clock without a frame (own app clock only). */
|
||||
|
||||
Reference in new issue
Block a user