Screen space shadow performance

I’m experimenting with Screen Space Shadows in URP (Unity 2022.2) to see if I can boost performance.

I have a scene with around 10,000 trees on a 2k terrain. When I enable the renderer feature, I see that it’s creating a texture for the shadows in the Frame Debugger. However, it doesn’t improve my GPU frame time. If anything, it’s slightly slower when screen space shadows are enabled and nothing visually changes.

The docs state screen-space shadows can benefit the runtime resource intensity - but under what circumstances would that actually be?

I had hoped at least 1 of 2 things would happen when using them for my large open world:

  • The performance would increase when used with a large number of shadow casting objects (e.g. trees)
  • The distant trees would get crisper shadows rather than the blurriness caused by my final cascade. Notice my shadow cascade settings - I’m aiming for crisp enough distant shadows up to 3000m but also very crisp shadows near the player (because in URP shadows flicker like crazy near the camera if you have a constantly moving directional light unless you use aggressive settings like this).

1 Like

Hi, screen space shadow in URP samples main light shadow map and output to a render texture.

Unlike the one in HDRP, it will not improve shadow quality in URP at all. (It’s not a screen space effect)

As for the performance improvement, I think you can try to lowering down the rendering resolution (Render Scale) while using a high resolution shadow map to make it more obvious.

  • Disable: each (opaque) tree will sample main light shadow map (high resolution) directly.
  • Enable: each (opaque) tree will sample screen space shadow map (rendering resolution).
1 Like