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.
This commit is contained in:
@@ -63,6 +63,7 @@ export function Lighting(): React.JSX.Element {
|
|||||||
|
|
||||||
configureSunShadow(sun.current, sunTarget.current);
|
configureSunShadow(sun.current, sunTarget.current);
|
||||||
configureRendererShadows(gl);
|
configureRendererShadows(gl);
|
||||||
|
sun.current.shadow.needsUpdate = true;
|
||||||
}, [gl]);
|
}, [gl]);
|
||||||
|
|
||||||
useDebugFolder("Lighting", (folder) => {
|
useDebugFolder("Lighting", (folder) => {
|
||||||
@@ -114,6 +115,7 @@ export function Lighting(): React.JSX.Element {
|
|||||||
sun.current.color.set(LIGHTING_STATE.sunColor);
|
sun.current.color.set(LIGHTING_STATE.sunColor);
|
||||||
sun.current.intensity = LIGHTING_STATE.sunIntensity;
|
sun.current.intensity = LIGHTING_STATE.sunIntensity;
|
||||||
sun.current.updateMatrixWorld();
|
sun.current.updateMatrixWorld();
|
||||||
|
sun.current.shadow.needsUpdate = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user