DirectionalLight ShadowDepths performance (Cascaded shadow maps)

Hi,

I am currently struggling optimizing my scene. I have a movable DirectionalLight with a very shallow angle (sunrise). I get huge frame drops when looking in the same direction as the light points to.
The scene has a landscape with foliage and a building. Camera is inside a room in this scene and roughly points in the same direction as the light.
I investigated in renderdoc and noticed that even the smallest details are drawn in the shadow depths (tried to visualize it as GIF).
This makes me wonder: isn’t there any culling? Objects behind a wall wouldn’t need to be drawn, do they? (from light perspective)

Any suggestions how to improve performance here?

Meshes are optimized and have LODs, so no high poly stuff here.

I am using:
UE5.4.4
Forward Rendering
No baked lighting (all dynamic)

ShadowDepths pass from light perspective:
shadowdepths

Long shadows have always been a struggle for realtime graphics and games have been cheating to get sunrises/sunsets to look good, making it start higher in the sky, stop casting shadows early, or even putting the sun in the skybox and the directional light casting shadows at different angles.

Beyond that-

Try playing with r.shadow.radiusthreshold

It prevents assets that are small on screen from casting shadows, I see people using r.Shadow.RadiusThreshold values like .01 - .06, but I haven’t played around with it too much, console command documentation will tell you more than I can.

Thank you very much. Altering this value is sufficient to gain enough performance for me. Played around with it a little and indeed values between 0.01 and 0.06 seems to be a good range. I added custom scalability settings now with 0.03 in EPIC (0.01 default). Happy with it :slight_smile:

Forgot to mention another thing that could help- you can also try using HLODs to merge together clusters of meshes at a distance.

cool, never bothered using HLODs, sounds like it could boost performance in this case. I’ll definitely try it