Quick answer: Increase r.Shadow.Virtual.MaxPhysicalPages for a larger cache. Reduce movable light count and influence radius. Visualize with r.Shadow.Virtual.Visualize 1 to identify which lights cause the most re-render.
Camera rotation triggers a 30ms GPU spike. VSM is invalidating and re-rendering most pages every frame because the cache is too small or the lights too numerous.
The Symptom
GPU profile shows ShadowDepths spiking on camera motion. Frame time correlates with rotation speed. Static camera = stable frames.
The Fix
Step 1: Visualize. Console: r.Shadow.Virtual.Visualize 1. Overlay shows page allocation per light. Red regions = thrash.
Step 2: Bigger cache.
r.Shadow.Virtual.MaxPhysicalPages 8192 ; default 4096; double for high-VRAM GPUs
More pages = more retained per-light shadow data, less re-render on motion.
Step 3: Trim lights.
- Reduce per-light Attenuation Radius. Smaller area = fewer pages.
- Mark distant lights Static (baked) instead of Movable.
- Cull lights at distance with the engine’s LightCullingDistance.
Step 4: LOD bias.
r.Shadow.Virtual.ResolutionLodBiasDirectional 1.0
r.Shadow.Virtual.ResolutionLodBiasLocal 1.0
+1.0 halves shadow texel density — less GPU, slightly softer shadows.
Verifying
Run with stat GPU. ShadowDepths line should drop. Visualizer shows fewer red areas. Frame time on camera motion comes down.
“Bigger cache. Fewer movable lights. LOD bias up. Shadows stable under motion.”
Related Issues
For Niagara bounds, see Niagara bounds. For foliage culling, see foliage.
Cache size. Light count. LOD bias. VSM smooths.