Frame Debug: UpdateDepthTexture uses 1500 draw calls

Hello, I’m having an issue with my scene: Frame Debugger shows, that something called “UpdateDepthTexture” uses 1500 draw calls.
Can anyone help me with this? What exactly is this updating of depth texture?

Thanks

58328-2015-11-18-14-57-22.png

Hi, when an image effect needs a depth buffer, the rendering system has to render this depth buffer as an additional pass. This means that all opaque objects will be rendered to a render texture with a special shader that only render the Z (think of a grayscale texture where black is near and white is far).

This pass is usually done first, then objects are rendered with regular shaders. Then image effects will use the depth texture in their shaders.

While the depth shader is quite simple and fast, it causes additional draw calls. Try removing the image effects in your scene to see that this rendering pass is removed (I suspect the AA effect being the cause, some AA shaders need a depth buffer, depth of field or AO usually do too)

Check other answers to learn more about reducing the number of draw calls. This becomes more important when some depth pass like this are used as each object will be rendered more than 1 time (1 for depth, 1 or more for shadows, one for colors, sometimes for additional lights etc…)

Edit: there may be some differences between forward and deferred rendering, maybe you could try different settings.