Virtual shadows and dynamic time of day

Hi,

Currently, I have a scenario with dynamic time of day, and cached virtual shadows issue.

The time of day update, invalidates all the cache, causing performance issues, and lots of vegetation.

Is it possible to stop virtual shadows from updating at least regularly from this type of source?

How much is possible to control the refresh rate of different mips for virtual shadows?

Regards

Hello there,

I do not believe it is possible to only update some mips, at least not without significant modifications. I’ve linked a case below that touches on this more deeply.

Would you be able to expand on what is costing you in the update? It’s possible there is high overdraw if the shadow depths cost is high.

The directional lights will invalidate their caches every frame in a continuous time of day, but other lights will retain their caches. Reducing the frequency of updates to the directional light would potentially reduce the average cost, but that is somewhat misleading as the frame time of update frames will still exhibit the issues and potentially become noticeable to users as inconsistent frame times.

The CVars r.Shadow.Virtual.ResolutionLodBiasDirectional and r.Shadow.Virtual.Cache.StaticSeparate 0 may be useful if the lights are always updating. The former reduces overall directional light resolution, and the latter is useful if the time of day updates are continuous as it will reduce the memory in use by VSMs. In other scenes, the static/dynamic caches are a performance optimisation.

I’ve linked some additional resources below:

[Continuous Time of Day and [Content removed]

[VSM cache is fully invalidated while implementing a dynamic time of [Content removed]

The second link touches on time slicing the updates and that the results in testing were unsatisfactory.

I hope that helps.

Best regards,

Chris