Files
gods-eye-view/src/globe/navara/cockpitClouds.js
T
German Khokhlov f0d38897f4 Drive the Navara volumetric clouds from the cockpit weather behind an optional render.setCloudCover capability
The cockpit's weather feed moves out of the Cesium cloud pass and serves both: Cesium keeps its own cloud canvas, an engine with its own clouds takes their cover from the same observations, with no second WebGL canvas.
2026-11-03 21:22:34 +04:00

22 lines
795 B
JavaScript

// The cloud cover port createNavaraEngine takes (render.setCloudCover): the
// cockpit's weather clouds drawn by Navara's own volumetric clouds, the
// look's cloud effect (look.js), instead of a second WebGL canvas. Only a
// look that draws clouds has it (the cinematic look; not on a
// mobile-optimized view). Destroying it gives the look its own cover back.
/**
* @param {{ hasClouds: boolean, setCloudCoverage: (coverage: number | null) => boolean }} look
* @returns {{ set: (state: { coverage: number | null }) => void, destroy: () => void } | null}
*/
export function createNavaraCloudCover(look) {
if (!look?.hasClouds) return null;
return {
set({ coverage }) {
look.setCloudCoverage(coverage);
},
destroy() {
look.setCloudCoverage(null);
},
};
}