From e13cf1e4c73f7fbca3c73a783789f19f6e36d6ad Mon Sep 17 00:00:00 2001 From: Tom Boullay Date: Mon, 1 Jun 2026 14:46:57 +0200 Subject: [PATCH] fix(world): force per-frame sun shadow refresh Restore sun.shadow.needsUpdate = true at mount and in useFrame after updateMatrixWorld. Lost during SHADOW_CONFIG centralization. Matches develop's belt-and-suspenders pattern; autoUpdate alone is insufficient because the sun follows the camera (matrix dirty every frame) and three.js can skip shadow map re-render. --- src/world/Lighting.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/world/Lighting.tsx b/src/world/Lighting.tsx index 2d49f48..4912046 100644 --- a/src/world/Lighting.tsx +++ b/src/world/Lighting.tsx @@ -63,6 +63,7 @@ export function Lighting(): React.JSX.Element { configureSunShadow(sun.current, sunTarget.current); configureRendererShadows(gl); + sun.current.shadow.needsUpdate = true; }, [gl]); useDebugFolder("Lighting", (folder) => { @@ -114,6 +115,7 @@ export function Lighting(): React.JSX.Element { sun.current.color.set(LIGHTING_STATE.sunColor); sun.current.intensity = LIGHTING_STATE.sunIntensity; sun.current.updateMatrixWorld(); + sun.current.shadow.needsUpdate = true; } });