What's going on with my draw calls?

So I did some research on draw calls today, starting with a blank level and adding:

  • Static lighting (Static skylight and
    Static Directional Light)
  • x1 ground Static mesh (1 material)
  • x1 cube Static mesh (1 material)
  • Both meshes share the same material

What I found (using stat scenerendering) was interesting; For some reason each mesh adds two draw calls to the scene, despite the fact they each have only one material each. So 2 meshes = 4 draw calls. This is not as expected, especially with static lighting. It looks like Unreal is currently doubling the amount of draw calls for each Static mesh for no reason (that i know of).
The same thing happens with Foliage instances; paint one mesh with one material x50 and you get 2 draw calls - not bad but certainly not as expected.

Anyone have any insight into this?!

It is probably just the meshes being drawn in the pre-pass in addition to the main rendering pass.

Interesting, so what does the pre-pass usually consist of? Depth buffer?

Also, is there anything I can do to prevent doubling the draw calls in the pre-pass?

You can change what is drawn in the pre-pass, though usually you want things in the pre-pass so that the z buffer is pre-loaded reducing the bandwidth used to fill the gbuffer. The draw calls in the pre-pass are cheaper as well - aside from skinned/unskinned the shaders don’t really change as it’s just depth being written out so the cost per call isn’t as large as during the main pass.

Ah i see, thanks for the info, super useful :slight_smile: