mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Draw the weather and wind imagery through the renderer's globe port
Radar, satellite clouds and lightning frames are imagery layers of the globe port instead of Cesium providers in the viewer's collection. A frame stages as a transparent layer on the globe's surface and counts its tiles through the layer's admit hook; the global infrared mosaic draws each tile of the geographic grid from the decoded canvas, the regional infrared transfer runs as the layer's tile transform on the upright tile, and throttled tiles are fetched again by the renderer. Readiness reads the port's imagery settling, the camera port gives the view and its move end, and the frame's credit, which a refreshed manifest can still change in place, is owed through the credits port while the layer is shown. Without a host the shown frame is hidden rather than detached. Wind's colour field is a port layer too, so the draw order is a zOrder per product (wind, infrared, radar, lightning), above the port's other imagery, and the raise-to-top helper goes. The Cesium port keeps a tile transform's bitmaps in straight alpha and closes the copies it spends, and a provider that fails to build is told as an error of its root tile. The weather rendering and raster tile modules no longer reach Cesium and leave the allow-list; the 3D Tiles shell still does.
This commit is contained in:
1 parent
9e1f9a1c3d
commit
76880f6eae
15 files changed
+735
-721
No files matched your search
@@ -1,17 +1,12 @@
|
||||
const priorities = new WeakMap();
|
||||
|
||||
/** Scalar context, infrared, radar, then lightning: independent of enable order. */
|
||||
export function orderWeatherImagery(collection, layer, priority) {
|
||||
priorities.set(layer, priority);
|
||||
if (typeof collection.raiseToTop !== 'function') return;
|
||||
const weather = [];
|
||||
for (let i = 0; i < collection.length; i++) {
|
||||
const item = collection.get(i);
|
||||
if (priorities.has(item)) weather.push(item);
|
||||
}
|
||||
const ordered = [...weather].sort(
|
||||
(a, b) => priorities.get(a) - priorities.get(b),
|
||||
);
|
||||
if (weather.every((item, i) => item === ordered[i])) return;
|
||||
for (const item of ordered) collection.raiseToTop(item);
|
||||
}
|
||||
/**
|
||||
* Draw order of the weather imagery through the globe port: scalar context
|
||||
* (wind), infrared, radar, then lightning, independent of enable order, and
|
||||
* above the port's other layers (zOrder 0).
|
||||
*/
|
||||
export const WEATHER_IMAGERY_Z = Object.freeze({
|
||||
wind: 1,
|
||||
clouds: 2,
|
||||
'clouds-regional': 2,
|
||||
radar: 3,
|
||||
lightning: 4,
|
||||
});
|
||||
Reference in new issue
Block a user