I have a scene with lots of stationary omni lights with shadow. Frame is static.
shadow map performance : Shadow Depth = 0.02ms
VSM performance : Shadow Depth = 22.45ms
VSM claims that it should only render shadows on change:
Pages are allocated and rendered only as needed to shade on-screen pixels based on an analysis of the depth buffer. The pages are cached between frames unless they are invalidated by moving objects or light, which further improves performance.
But it seem this is not the case. Is that a bug?
UE 5.0.3
no, those are not nanite meshes. Why nanite is required for VSM? I’ve worked on several other engines and VSM worked just fine with conventional geometry.
In this case all should be cached, it does not matter what geometry am I using because no invalidation occurs, no cache pages should update.
Man, it’d be great if there was some feature that would improve performance with VSM…
" Multiple Lights Performance
Performance in scenes with many small local lights is still a work in progress. For the time being, the best strategy is to enable one pass projection and be very careful with invalidations to keep as many of the pages cached as possible. Multiple local lights will perform far better with Nanite geometry than non-Nanite geometry, so aggressively culling or disabling shadow casting on non-Nanite geometry in the distance can help a lot."
Thanks for the answer!
So, one-pass projection speeds-up shadow projection by 4ms, which is huge gain. Now clustered shading + VSM projection takes about 1ms. That seem reasonable.
But Shadow Depths are still there, doing God knows what. TAA caused some occasional page invalidation, so I’ve disabled it, now UE tells me that there are 0 Draw in pages goin on. Yet it still takes ~ 2ms
Most of that time in so-called RasterPasses per each light. Is this a constant overhead of VSM?