mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
fix(sky): restore the Milky Way on teardown, tidy the anime QA script
- VisualEffects.destroy() puts skyBox.milkyWayVisibility back to 1, as it already restores the borrowed bloom stage, so a surviving viewer does not keep a faded sky. - Rename scripts/qa-anime-space-mask.mjs to qa-anime-sky.mjs: rewrite the header for the current approach, drop --space-expr and --repo, import puppeteer as a package, reject unknown cases and count the milkyway case as reached only while the anime stage is on. - Put both sky QA scripts under format:check. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
65b98b4971
commit
8deb47560e
4 files changed
+78
-42
No files matched your search
@@ -115,7 +115,7 @@ export class VisualEffects {
|
||||
// Anime's four luminance bands turn the faint Milky Way into blotches, and
|
||||
// a post-process cannot tell the sky from far geometry reliably (near
|
||||
// plane clamps, keyless terrain above the ellipsoid horizon): fade the
|
||||
// glow out with the style instead. Stars survive as banded points.
|
||||
// glow out with the style instead. Bright stars survive as banded points.
|
||||
if (stage === this.stages.anime) {
|
||||
const sky = this.viewer.scene?.skyBox;
|
||||
if (sky && 'milkyWayVisibility' in sky)
|
||||
@@ -228,7 +228,7 @@ export class VisualEffects {
|
||||
this.transitions.clear();
|
||||
}
|
||||
|
||||
/** Remove owned stages and restore the borrowed bloom stage after callers release it. */
|
||||
/** Remove owned stages and restore the borrowed bloom stage and sky after callers release them. */
|
||||
destroy() {
|
||||
if (this.destroyed) return;
|
||||
this.stop();
|
||||
@@ -240,5 +240,11 @@ export class VisualEffects {
|
||||
Object.assign(this.bloomStage.uniforms, this.previousBloom.uniforms);
|
||||
this.bloomStage.enabled = this.previousBloom.enabled;
|
||||
}
|
||||
// Anime may have faded the Milky Way out; a surviving viewer gets it back.
|
||||
const sky = this.viewer.scene.skyBox;
|
||||
if (sky && 'milkyWayVisibility' in sky) {
|
||||
sky.milkyWayVisibility = 1;
|
||||
this.requestRender('style-stage');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -179,6 +179,24 @@ test('the anime stage fades the Milky Way out with its own intensity', () => {
|
||||
f.effects.destroy();
|
||||
});
|
||||
|
||||
test('destroying the effects gives a surviving viewer its Milky Way back', () => {
|
||||
const f = fixture();
|
||||
const sky = { milkyWayVisibility: 1 };
|
||||
f.effects.viewer.scene.skyBox = sky;
|
||||
f.effects.initStyles();
|
||||
f.effects.startTransition('anime', 0, 1);
|
||||
f.tick(250);
|
||||
f.effects.stop();
|
||||
const frozen = sky.milkyWayVisibility;
|
||||
assert.ok(
|
||||
frozen > 0 && frozen < 1,
|
||||
'stop keeps the stages, and the fade, as they are',
|
||||
);
|
||||
f.effects.destroy();
|
||||
assert.equal(sky.milkyWayVisibility, 1);
|
||||
assert.equal(f.requests.at(-1), 'style-stage');
|
||||
});
|
||||
|
||||
test('bloom retains its dead zone, normalized intensity and independent toggle', () => {
|
||||
const f = fixture();
|
||||
f.effects.initPostProcess();
|
||||
|
||||
Reference in new issue
Block a user