optimizing ipad performance with draw calls

Hi everyone,

I’ve been trying to analyze what causes the fps going down so low in my game, and after I tested in couple scenario, it seems reducing draw calls is my prime target. So here are the 3 main problems I’m facing

  • The problem is I have a prefab of group of archers (4x4 = 16 archer models) and each model contains a bow, a quiver, an arrow, and the archer model itself. Totalling 16 archers * 4 geometries = 64 draw calls for 1 group. And the worst case scenario is there will be 8 groups of archers in screen, totalling 512 draw calls.
    Even if Unity batches them, I still ends with around 220~230+ draw calls and 360+ batched draw calls.

The next logical step I have is to combine those 4 geometries into 1. However after trying to use CombineMesh() from the Unity Script Reference page, the bow, arrow, and quiver are no longer in the appropriate position and more importantly, they don’t animate anymore.

The rigger said those 3 components are parented to the archer left hand, right hand, and back respectively.

Is it a good idea to tell the modeller/rigger to combine those 4 geometries into 1? Is it possible? Or do I have any other options for combining those actually-passive meshes into 1 with the body but still preserving the animation ?

  • Furthermore, I’d like to ask what’s the maximum draw calls/tris count should be allowed in deployment in iPad? Currently I have about close to 400 draw calls and 350+ batched call with 70k tris (degenerate triangles included)-9.1k batched, and 37k verts-4.3k batched. And that makes the fps drops to 13 fps.

There’s one scenario with 236 draw calls, 40.5k tris and 19k verts with 0 batch on them allows the game run at 25~26 fps.

So I’m guessing <200 draw call with <60k tris should be my aim?

  • The degenerate triangles due to stripifying process in the models already doubles the tris count when the scene is deployed in iPad. Can I reduce the number of degenerate triangles further than factor 2.0 ?

P.S : Why is that when I use OnGUI() function, the batching (especially tris and verts) go down in the gutter? This only occurs when deploying to iPad, not in Mac/Window environment

Thanks in Advance,

upto 120 or 130 draw calls it wont give problems! and draw call isnt the only thing that affects the performance! chck for number of tris and also VRAM it is using in the ipad resolution! And also u can reduce the draw calls from OnGUI() function by enclosing all the contents inside a if loop like this one

if(Event.current==EventType.Repaint)
{
           //ur GUI content
}

The above code would reduce teh draw call by half from the GUI part of the game!

also try to make models such a way that the archer model, bow and quiver (or even arrows!!) share a single material!! this would reduce the draw call from 64(as u said) to 32!!

Then check for the shaders you are using and the number of passes in it !! this could also cause the increase the draw calls!

And if u r using instantiate and Destroy for shooting of arrows change the logic and jus translate them with the one attached to the bow. Instantiate and destroy are costly!
like wise i can say a lot of suggestions but better look into Optmizing for IOS page of unity!

hope it helps :slight_smile: