fix(anime): fade the Milky Way out instead of masking the sky by depth

The far-plane mask in the anime shader read the post-process depth, which
cannot tell the sky from far geometry: with a layer that clamps the near
plane to 0.1 m (satellites) the whole Earth lost its cel bands, keyless
terrain above the ellipsoid horizon did too, and the atmosphere, Sun and
Moon stopped banding.

Restore the anime shader from main and fade the Milky Way glow with the
style instead: VisualEffects sets skyBox.milkyWayVisibility to
1 - anime intensity. scripts/qa-anime-space-mask.mjs checks all three
cases headless and that the anime sky shows no bands.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
German KhokhlovandClaude Opus 5.5 committed 2026-10-19 22:27:28 +04:00
1 parent adeee12209
commit e652e50d5c
6 files changed
+357 -7

No files matched your search

+9
View File
@@ -112,6 +112,15 @@ export class VisualEffects {
if (this.stopped || !stage) return;
stage.uniforms.intensity = value;
stage.enabled = value > 0.001;
// 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.
if (stage === this.stages.anime) {
const sky = this.viewer.scene?.skyBox;
if (sky && 'milkyWayVisibility' in sky)
sky.milkyWayVisibility = 1 - value;
}
if (stage.enabled && stage.uniforms.time !== undefined)
this.startAnimationLoop();
this.requestRender('style-stage');