- Home /
Batching instances of same model with same material... doesn't work
Hi,
I created a box model in blender with a material associated that has a texture (the texture is an atlas, so only one part of this texture is mapped to the faces of this box).
I created a prefab in unity with this model and i've enable light probing and rigid body for it (this box is a dynamical object). Then i've created many instances of this prefab in the scene.
If i understood correctly, Unity should batch all the instances of these box and draw all them in a single draw call because they share the same material (and the same mesh too), but if i see the Profiler i see a lot of draw calls (about 78) when the boxes are within the camera frustum. This is not a problem on desktop, but on iOS it is a problem.
Why does Unity use all these draw calls to draw the same models ? does i need to enable something ?
I tried the game on my iOS device and it slow down from 30 fps to 22-20 fps when the camera renders the boxes (but i'm unable to verify if on iOS Unity batches the boxes because, as far as i know, i can only see the profiler statistics when i run the game inside unity editor, is it true or there is a way to profile also on the device ?).
Thanks!
Answer by ScroodgeM · Jul 20, 2012 at 08:07 AM
instantiate all objects on the screen and move camera VERY far away from current position, but don't lose focus on objects - notice draw calls changes
now try don't move camera and change near clip plane of current camera (leaving object farther them near clip plane) - does it affect draw calls?
Your answer
![](https://koobas.hobune.stream/wayback/20220613072657im_/https://answers.unity.com/themes/thub/images/avi.jpg)