My question is about “Saved by batching”
When I’m using multiple cube meshes that has same material,
Drawing call is going to fixed, but “Saved by batching” is going to increasing.
and I could save not only drawing call but also performance.
But I found something interesting,
if I use Sphere mesh or Capsule meshe instead of cube meshe that has same material,
“Saved by batching” is not going to increasing, but drawing call is increasing.
Why I couldn’t save Sphere or Capsule meshes’s drawing call from “Saved by batching”
even I used same material?
Actually for the dynamic batching(method that converts multiple objects to one draw call) to happen, the objects should be less than a certain size.
The cube has only 6 vertices (select the object in editor, the places where wire mesh lines meet are vertices, in cube they will meet only corners, but in sphere u would see a lot of places where they meet) where as the sphere is complicated, it has more vertices. so objects with more vertices are not batched by unity automatically.
In computer graphics everything you would see is made of triangles. So if you a seeing a square shaped object, it means there are 2 triangles in it. A triangle in graphics is formed by vertices(3 vertices connected = 1 triangle) . I guess you would understand now that the number of tris (triangles) increases if there are more vertices. Dynamic batching wont work if number of vertices/tris are more.
In this case you would have to go for static batching. It is simple to do. First in player settings - > Resolution and presentation. Make sure that the number of static batching is switched on and then. select all the spheres you want to batch and click on the static check box a the top right corner of the object to add the spheres to static batching.
It is a very good thing if objects are saved by batching. What is happening to you is exactly the way that it should work:) What you could try to get good results is to make the sphere a child of the cube and then apply the ‘combine children’ script, which will combine them into the same mesh, also you could check the cube, with the sphere as it child, as ‘static’ in the inspector. Only do these if the material is the same, but in your case, these things should work:)
Just a nitpick detail, but technically flat-shaded cubes have 24 vertices, because they need a unique set of 4 vertices for each of the 6 sides to have correct normals.