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:
German Khokhlov committed 2026-11-03 21:22:34 +04:00
1 parent d8c63c69d8
commit f0d38897f4
15 files changed
+1004 -79

No files matched your search

+17
View File
@@ -16,6 +16,7 @@ import {
cloudTerrainOffset,
landscapeSunTime,
CUMULUS_BASES,
LOCAL_CLOUD_COVERAGE,
globeLightingAt,
starsVisibleAt,
sunDateStale,
@@ -205,12 +206,28 @@ export function buildNavaraLook(
plan.meshes.find((desc) => Object.hasOwn(desc, 'stars'))?.stars
?.intensity ?? NAVARA_STARS_INTENSITY;
let starsDimmed = 0;
let cloudCoverage = LOCAL_CLOUD_COVERAGE;
return {
handles,
frame,
resetDaylight() {
daylightTime = null;
},
/** Whether the look draws volumetric clouds (cinematic, not on mobile). */
hasClouds: Boolean(clouds),
/**
* The clouds' cover (0..1), or null for the look's own
* (LOCAL_CLOUD_COVERAGE); true when it changed. Where and when they
* show stays the look's rule (height, sunlight).
*/
setCloudCoverage(coverage) {
if (!clouds) return false;
const next = coverage ?? LOCAL_CLOUD_COVERAGE;
if (next === cloudCoverage) return false;
cloudCoverage = next;
clouds.update({ clouds: { coverage: next } });
return true;
},
/** Dims the stars by `amount` (0 none, 1 hidden); true when it changed. */
setStarsDimmed(amount) {
const next = Math.min(1, Math.max(0, Number(amount) || 0));