Shdows - increase draw calls

Hello there, I have noticed that enabling of shadows dramatically increases number of draw calls.

Is this supposed behavior ? I can see it in debugger that I have 25 draw calls when disabled and by enabling shadows it rise to 65 and FPS decreases accordingly.

What am I missing ? I cannot see reason why should shadows increase number of draw calls and if they do - what is the logic behind ? Is it possible to somehow lower that number of draw calls caused by shadows ?

Thanx in advance !

Well rendering a shadow means rendering all your meshes to a shadow map. So if you have 25 draw calls you can expect the double as all your meshes must be rendered twice (once for the main target and once for the shadow map).
Then depending on the filter applied to your shadow map, more draw calls can be required to blur the shadow maps.
You can have a pretty nice view of that process using

Thank you very mcuh :wink: I thought that shadow rendering is completely different process that only works with geometry and doesnt care about materials - thats why I didnt see dependency with draw calls :slight_smile: This spector seems to be nice debugging tool, didnt know about its existence so far !!!

1 Like