Mesh Combining and Optimization

I have seen it written in many places that many local meshes sharing the same material can be combined to reduce draw calls. But I would like some clarification: is it supposed to be the mesh that is combined or the game object?

For example, let’s say that I have two, separate game objects, but BOTH use the same mesh asset (a QUAD), and BOTH use the same material? How does that impact performance and draw calls?

If you have two meshes* using the same material, they will result in 2 draw calls (putting aside dynamic batching). If those two mesh are set to Static, they will be combined (into a single larger mesh) by Unity and thus will result in one single draw call.

Many factors can affect this so doing a search and reading on Dynamic and Static batching will give lot of information.

  • those meshes do not have to be the same as per the attached image below of a cube and sphere set as Static and using the same material. Those mesh sharing the same material is the key and it cannot be an instance of that material.

1144942--43380--$Combined Mesh.JPG

Provided Static Batching is turned on in the Project Settings → Player Settings panel.

Note that static batching incurs a memory cost - it effectively stores a complete copy of the mesh for each position in which it’s used.