Draw call question

Hi, if i have an actor in the scene with 10 mesh inside, then thats will be 1 draw call or 10?
(don’t count the material now)

“It depends”

Probably the simplest answer is that the fact that they’re inside one actor makes no difference.

If they’re all using the same mesh and materials they might get automatically batched into a single draw call, but there may be circumstances where they won’t. If they’re HISM/ISM components as opposed to regular static mesh components then they’ll obviously be instanced. If they’re all regular static mesh components using different meshes then they will each be individual draw calls.

Thanks. These are different meshes. Then better if i will merge the 10 mesh into one, i think.
Its for a mobile app, and try to optimize the level.

Also, depends on the number of different material-instances in the group, the number of material-slots on each mesh; what is unique and what can be shared, etc.

Recommend this vid to help w/understanding some tips/tricks/mechanics around this part of the rendering process. The first section, on custom-primitive-data is a must-know: UE4 Material Tricks you didn't know - YouTube

Each mesh counts as 2 draw calls, 1 for mesh itself, 1 for each material.
Mesh with 5 materials will have 6 draw calls.

Shadow and light maps break batching, also changed MI parameters, but as IlIFreneticIlI mentioned, custom primitive data helps to avoid batch breaking by MI params.

If this were true, batching would be completely worthless. Because virtually every object in the scene is affected by one of those two things. Here’s the effect of Unreal’s batching on 3308 static meshes with lightmaps.

I have seen it noted that meshes don’t get batched for shadow depths of non-directional lights, but I haven’t tested this.

A material instance is treated the same as a material. If two objects have the same mesh and the same material instance, they will get batched, whether it has changed parameters or not.

If you create a dynamic material instance so that you can individually change the parameters then they will not be batched, as you’re not using the same material anymore, essentially you’ve created a different material.

1 Like

Thanks for the clarification! It looks like the draw call puzzle is almost complete =)

1 Like