ShadowDepths in GPU visualizer hurting performance

Hi-running through some of the GPU profiler stats and I am noticing in several parts of my scene that “ShadowDepths” are taking 6-7ms to calculate. My scene is running at about 75fps with about 17ms, so this is playing a large role is the high response time. The scene is a courtyard with foliage. Materials do include subsurface scattering and I have CSM on the directional light. Are these responsible? In general where can I find more information on each variable listed in the profiler?

Shadow depths is basically dynamic shadowmap rendering. If it’s taking too long you might need to turn off shadow casting on some meshes that don’t have that noticeable shadows in the first place.

I have movable only char but

ps: ohh It’s because I didn’t bake all object on the scene(

“ShadowDepths”: generation of shadow depth maps. It’s independent of the game resolution. Depends purely on the amount of shadow-casting lights in your scene, the geometry they have on it’s way (that casts shadows). The quality settings also matter.

I explain it in my vid:


I still don’t understand how ShadowDepths works. I’m working on an open world game, using only one movable directional light for sun shadows (no other light)
CSM distance is set to 10k (lower means less FPS !?), using 2 cascades (3 or 4 cascades decrease framerate by 2 or 3 fps).
CSM resolution is decreased to 1024.
Only shadow casting meshes are some trees, bushes and really few rocks (shadows disable for grass/flowers and other foliage. Looks ugly but trying to optimize framerate)
All shadow casting meshes use agressive LODs and billboards
Shadow quality set to medium (low setting removes all shadow)
Compiled game running in 720p still has ~15ms of ShadowDepths

Dont necro, also, what are your specs?

This is a game dev forum, not a gaming forum.

Duh, but, if your running ue4 on a crappy old laptop, of course shadowdepths will lag. Plus specs are mentioned when important, It could be your project or your hardware, nobody will know if you do not tell which is which.

no, lower means “more FPS”
CSM distance is how far (from the camera) objects cast shadows. more objects = less FPS.

Yes, it should means more framerate but that’s not what I get. 20k is slightly faster (by 3-4 fps) than 10k. Maybe because cascades are more stretched at 20k than 10k

Old thread but I wonder if you had Distance Field shadowing enabled? (happens outside the cascaded shadow radius) If you did, I’ve noticed (depending on the view) these can be slower than the cascaded shadows. That’s one thing that could explain it getting slower when you reduce the distance. The only other thing I can think of is lighting wasn’t built.

Maybe I’m wrong but I think that the distance field shadows cost goes into “ShadowProjection”, not “ShadowDepths”. The problem only comes from Shadow Depths and I’ve found out that it comes from the landscape

Yes you’re right about where the cost goes, it looked like you had changed to talking about overall FPS.
Ah yes the landscape does make sense I suppose, rendering large expensive components into all cascades instead of just one. For the benefit of others who find this thread, presume you tried reducing your component size on the landscape after discovering that? (Or just turn shadowcasting off on the landscape components that don’t need it)