CSM Caching and Objects Culling Questions

Hi, I was investigating CSM shadow scrolling for mobile devices and found out that caching works the following way: first, it scrolls cached static geometry cascade until overlap throttle is reached, then it redraws cached cascade entirely. Was the reason for not implementing continuous update? I mean, would it be worse to scroll the cached cascades every frame and render the newly appeared static geometry there instead of into the final shadow map, in order to reuse this geometry next frame and get rid of frames with redrawing the entire cascade?

And the second related question - do I understand correctly that the octree shadow frustum cull doesn’t take into consideration additional pair of culling planes and performs linear search with checking them afterwards? If yes, was this approach chosen for some reason or is it planned for future improvement?

https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/Renderer/Private/ShadowSetup.cpp\#L5015

Hi,

For the first question, you can see the entire process of CSM Cache Scrolling. The dashed-line rectangle represents the cached shadow map, which only caches a portion of the final shadow map that includes static meshes. The meshes overlap the new region that needs to be rendered until the throttle is reached. Additionally, dynamic meshes must be rendered to the final shadow map.

It could generate the cached shadow map whenever the camera scrolls, but I’m not sure which is better, since it needs one extra RT copy each time and doubles the bandwidth.

[Image Removed]​

doesn’t take into consideration additional pair of culling planes I didn’t unstand what you mean.

AFAIK, the steps for octree shadow culling are:

  1. Go through the octree from root to leaf.
  2. If the node didn’t collide with the frustom, it will be culled
  3. If it did collide with frustom, primitives inside the nodes will be added for further testing.

Hello, thank you for the information, yes probably there is no better way to check if this alternative approach is better rather than implementing it and measuring in the real scenarios

Regarding the octree shadow culling, did I understand correctly that while traversing the octree, the culling of nodes is done for the entire cascade frustum, not only for the new region outside the cached area? And is that because the octree nodes contain both static (which later will be tested agains the new region) and dynamic (which should be always rendered) primitives?

Yes, you are correct.