- Home /
Batching on Mobile = Bad? Your experience.
Hello there
We're working on a 3D game for iOS and Android and made a striking discovery today. In short: It improved our performance significantly to turn off batching.
In our game, there are long, side-scrolling 3D levels with somewhere between 150k-200k triangles each. The scenes are built in a modular fashion: consisting of about 500-1000 single objects that share one or two materials. We're using static batching on the whole scene to reduce drawcalls and really got it down to 3-8 drawcalls (in the editor). Still, we were experiencing performance troubles on not-so-new hardware (iPhone4, Samsung Galaxy S & S II).
After turning off static batching for all objects in one scene, we improved performance on Galaxy S II from about 20-25 fps to a stable 60 fps! And looking in the editor, there is no dynamic batching happening on the level objects either. It shows between 40-90 drawcalls in each frame.
Now, we are really confused. This seems run against most things that we have read AND experienced so far in terms of optimizing for mobile. How can this work? I thought drawcalls are extremely critical on mobile?
I would be really curious about your practice and experience in this regard.
Thanks!
Well I too turned off static batching because it means that occlusion culling and even frustum culling do not work. So I'm not surprised you had a similar result. 90 draw calls isn't the end of the world compared to all of the extra vertices that need rendering I guess - 400 draw calls would be more of a problem.
For Impostors I create skinned meshes for a single draw call result - this does perform O$$anonymous$$, but only because I am forcing everything not being drawn to be outside the frustum from the shader's perspective (and tiny for the fragment part) and in any case the nature of Impostors is that you want lots in view.
Answer by Sisso · Mar 07, 2014 at 11:39 AM
Batching is not bad, but like any other optimization you must apply when its needed, with a profile test :P
Batching "merge" all meshes and draw in a single draw call. So you is always drawing a very big mesh, it is very good to reduce draw calls. Because you already create a scene in a modular fashion you are drawing very few triangles each time, but with more draw calls.
Create modular meshes with controllable triangles disposed in scene to have a average draw call is a very good way to create optimized sceneries. But it gives much more work that place hundred of objects and apply static batch.