From 0dd8a9031f1e952a3e8ea0b7d06fde4d4ff18688 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 28 Apr 2026 04:34:33 +0200 Subject: [PATCH] Sync god rays light source with dominant celestial light --- src/viewport-three/viewport-host.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/viewport-three/viewport-host.ts b/src/viewport-three/viewport-host.ts index 7929a045..329fba10 100644 --- a/src/viewport-three/viewport-host.ts +++ b/src/viewport-three/viewport-host.ts @@ -2088,11 +2088,15 @@ export class ViewportHost { this.ambientLight.color.set(displayedAmbientLight.colorHex); this.ambientLight.intensity = displayedAmbientLight.intensity; - this.currentCelestialShadowCaster = - resolveDominantCelestialShadowCaster( - displayedSunLight, - displayedMoonLight - )?.key ?? null; + const dominantCelestialLight = resolveDominantCelestialShadowCaster( + displayedSunLight, + displayedMoonLight + ); + this.currentCelestialShadowCaster = dominantCelestialLight?.key ?? null; + syncScreenSpaceGodRaysLightSource( + this.godRaysLightSource, + dominantCelestialLight?.light ?? null + ); this.sunLight.color.set(displayedSunLight.colorHex); this.sunLight.intensity = displayedSunLight.intensity; this.sunLight.position