Keep Navara cinematic clouds visible at flight altitudes

This commit is contained in:
German Khokhlov committed 2026-11-02 21:27:29 +04:00
1 parent 96ce795f8c
commit 8b179a7e01
4 files changed
+6 -4

No files matched your search

+2 -2
View File
@@ -164,7 +164,7 @@ export function buildNavaraLook(
}
}
// Terrain-relative layers keep distant cumulus above mountain ridges.
// Keep a downward view clear once the camera rises above the cloud deck.
// Keep the deck visible from aircraft altitude, then clear it for regional views.
if (clouds) {
const offset = cloudTerrainOffset(height, ground);
const pass = clouds.ref?.raw;
@@ -179,7 +179,7 @@ export function buildNavaraLook(
}
}
cloudsSunlit = cloudsSunlitAt(elevation, cloudsSunlit);
const ceiling = CUMULUS_BASES[0] + offset + (cloudsShown ? 800 : 500);
const ceiling = offset + (cloudsShown ? 12_000 : 11_000);
const next = cloudsSunlit && height <= ceiling;
if (next !== cloudsShown) {
cloudsShown = next;
+2
View File
@@ -143,6 +143,8 @@ test('cumulus rises over mountain terrain and leaves the orbital view clear', ()
assert.deepEqual(clouds.updates, [{ visible: false }]);
look.frame(900, false, 0);
assert.deepEqual(clouds.updates.at(-1), { visible: true });
look.frame(6500, true, 0);
assert.deepEqual(clouds.updates.at(-1), { visible: true }, 'above the deck');
});
test('globe lighting switches on only at rest, and off even in motion', () => {
+1 -1
View File
@@ -83,7 +83,7 @@ export function globeLightingAt(height, current = false) {
// Navara cloud layers use ellipsoid heights. Over uplands raise the two
// cumulus layers together; at world scale a single ground sample no longer
// represents the whole view. Quantize the offset to avoid tiny layer updates.
export const LOCAL_CLOUD_COVERAGE = 0.22;
export const LOCAL_CLOUD_COVERAGE = 0.36;
export const CUMULUS_BASES = Object.freeze([1500, 1800]);
export function cloudTerrainOffset(height, ground) {
if (!Number.isFinite(ground) || height >= STARS_SPACE_ENTER_M) return 0;
+1 -1
View File
@@ -102,7 +102,7 @@ test('the cinematic look: photoreal plus clouds and ACES, no sun shadow maps, no
useNormalBuffer: false,
albedoScale: 2,
});
assert.equal(clouds.clouds.coverage, 0.22);
assert.equal(clouds.clouds.coverage, 0.36);
assert.equal(clouds.clouds.shadows, false, 'no cloud shadow maps');
assert.ok(
clouds.clouds.cloudLayers.every(({ altitude }) => altitude >= 1000),