mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 10:12:18 +00:00
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.
This commit is contained in:
1 parent
d8c63c69d8
commit
f0d38897f4
15 files changed
+1004
-79
No files matched your search
@@ -0,0 +1,21 @@
|
||||
// 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);
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user