- Home /
Draw calls keeps on increasing even if I use the same model with the same material(prefab)
I'm really confuse. I want to reduce the draw calls in my scene but even if the characters uses the same material the draw calls keeps on increasing.
The scenario is, I spawn 20 enemies(3d objects) from a prefab. I'm expecting 1 draw call, yet I get 20 draw calls from them too. For testing purpose I made them static but still the same(This is just for testing I know I should not do it on moving objects). I also enabled GPU instancing but it did not helped. I was hoping the CombineChildren script in standard asset would help but I think they remove it from the standard assets(I'm using 2017.4.2f2). So what else can I do?
Answer by TanselAltinel · May 02, 2018 at 03:26 PM
Hi,
You have to make sure you are fitting into the criteria listed in the Draw Call Batching documentation: https://docs.unity3d.com/Manual/DrawCallBatching.html
In order to see if it helps, I'd try:
Assigning the default Unity shader to prefab and see if they are batched
Making the mesh, prefab, and any thing related to have scale 1, 1, 1 in the inspector and make sure nothing changes it.
Make sure other criteria in the document is met.
by courtesy of @n3wb13 I'm adding this resource to answer in case someone misses the comment: https://blogs.unity3d.com/2017/04/03/how-to-see-why-your-draw-calls-are-not-batched-in-5-6/
Thanks buddy. I think I finally understood why it's not working and it's because I have a skinned mesh renderer. Also I want to add this link https://blogs.unity3d.com/2017/04/03/how-to-see-why-your-draw-calls-are-not-batched-in-5-6/ as additional source for anybody who are experiencing the same problem as I did.
Your answer
