[Godot 4.6] Severe DirectionalLight3D shadow flickering/jittering in VR (Forward+)

Godot Version

4.6.2

Question

Hi everyone,

I am developing a VR game using Godot 4.6 (Forward+ renderer) and testing it via PCVR streaming.

I am experiencing a severe issue with shadow flickering / edge jittering (often referred to as shadow swimming). The shadows cast by a DirectionalLight3D onto static buildings constantly flicker at the edges, even with the slightest head movement in the VR headset.

Interestingly, the shadows appear perfectly stable in the Godot editor viewport; the flickering only occurs during VR runtime.

To resolve this, I have already tried maximizing the shadow quality settings:

  • Directional Shadow Size: 8192

  • Soft Shadow Filter Quality: Soft (Ultra)

  • DirectionalLight3D: Enabled Blend Splits

  • Anti-Aliasing: Enabled MSAA 3D (4x)

I have also tested both the Mobile and Compatibility renderers, but the issue persists. I have attached a short video below to demonstrate the exact visual artifact.

Are there any specific workarounds, advanced rendering settings, or console commands to stabilize real-time shadows for VR in Godot 4?

Any advice or guidance would be greatly appreciated. Thank you!

Update: I found a crucial clue regarding the XR tracking.

I just did a cross-test using the MetaXRSimulator. When running the game through the simulator (simulating headset movement via mouse/keyboard on a flat screen), the shadows are perfectly stable.

The severe shadow flickering ONLY occurs when wearing the actual headset with real 6DOF physical tracking via PCVR streaming.

This strongly suggests the issue isn’t just shadow resolution, but rather how the DirectionalLight3D CSM (Cascaded Shadow Maps) texel snapping reacts to OpenXR tracking noise or the high-frequency micro-movements inherent to real headset tracking.

Does Godot 4 have a way to stabilize or decouple the shadow map projection matrix from these sub-millimeter OpenXR camera micro-movements?