mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 02:44:02 +00:00
fix(sky): keep the Milky Way out of model lighting, test the sky wiring
Scene reads skyBox._cubeMap as the environment map that lights models, in the TEME, flipY layout of Cesium's own sky box; the ICRF Milky Way would light them rotated. Rename the field so models keep Cesium's default. Test the anime fade on a real StarrySky and that the viewer gets the sky as an option (skyBox: false would drop the Sun and Moon). Correct three comments on the star limit and the Milky Way levels. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
86ae5e9cf4
commit
d94cc35c81
7 files changed
+54
-17
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { VisualEffects } from './visualEffects.js';
|
||||
import { MILKY_WAY_INTENSITY, StarrySky } from '../sky/starrySky.js';
|
||||
import {
|
||||
GLOBAL_POST_DEFAULTS,
|
||||
STYLE_PRESET_DEFAULTS,
|
||||
@@ -160,17 +161,19 @@ test('direct Cockpit intensity writes are reconciled before rendering', () => {
|
||||
|
||||
test('the anime stage fades the Milky Way out with its own intensity', () => {
|
||||
const f = fixture();
|
||||
const sky = { milkyWayVisibility: 1 };
|
||||
const sky = new StarrySky({ requestRender: () => {} });
|
||||
const glow = () => sky._milkyWayUniforms.u_intensity();
|
||||
f.effects.viewer.scene.skyBox = sky;
|
||||
f.effects.initStyles();
|
||||
f.effects.setStageIntensity(f.effects.stages.thermal, 1);
|
||||
assert.equal(sky.milkyWayVisibility, 1, 'other styles keep the glow');
|
||||
assert.equal(glow(), MILKY_WAY_INTENSITY, 'other styles keep the glow');
|
||||
f.effects.setStageIntensity(f.effects.stages.anime, 0.25);
|
||||
assert.equal(sky.milkyWayVisibility, 0.75);
|
||||
assert.equal(glow(), MILKY_WAY_INTENSITY * 0.75);
|
||||
f.effects.setStageIntensity(f.effects.stages.anime, 1);
|
||||
assert.equal(sky.milkyWayVisibility, 0);
|
||||
assert.equal(glow(), 0);
|
||||
f.effects.setStageIntensity(f.effects.stages.anime, 0);
|
||||
assert.equal(sky.milkyWayVisibility, 1);
|
||||
assert.equal(glow(), MILKY_WAY_INTENSITY);
|
||||
sky.destroy();
|
||||
// A sky box without the knob (Cesium's own) is left alone.
|
||||
const plain = {};
|
||||
f.effects.viewer.scene.skyBox = plain;
|
||||
|
||||
Reference in new issue
Block a user