- Home /
Draw calls when deploying to iPhone?
I was just checking my games draw calls, and its hovering around 24 - 28 draw calls when it has about 30 - 35 objects on the screen which is the most at the moment. But I intend to have a couple more with projectiles and so on.
I haven't got an apple developer account yet so I cant test the game on an iPhone but I heard a while back that you don't want your draw calls to be more then say 15 - 20 when deploying to the iPhone. Is this correct?
Im using unity pro. I have set dynamic and static batching to true but doesn't change much.
It's a simple 2d game so all the objects are 2 triangle planes.
The stats show are this at its worst. At the moment :)
Draw Calls: 28 batched: 0 Tris:56 Verts:112 Used Textures: 4 - 491.7KB Render Textures: 2 - 1.6MB
I'm not using SpriteManager.
My questions are. Will my draw calls change once its deployed? Do I have to do something else to make use of dynamic and static batching or do those kick in when the fps tanks? Or should I try my luck with sprite manager?
Answer by Eric5h5 · Dec 09, 2010 at 08:43 AM
It depends on what you want to target. 1st generation devices can handle rather fewer draw calls than the latest ones because the CPU is quite a bit faster now. There is no one answer.
You have to mark objects as static for static batching to do anything, plus they have to share a material. Dynamic batching works on objects that share a material and are fewer than 300 vertices (supposedly...some people seem to have a lower number; I don't know for sure). It's not something that "kicks in"...it either works or it doesn't.
Thanks Eric. That means Dynamic should be working for me. $$anonymous$$y objects have 4 verts and all share the same material.
How do you mark and object as static? For static batching?
I guess I'm not going to know how well it will do until I test it out. I think I might go with Sprite$$anonymous$$anager though. The draw calls will drop heaps.
You mark objects as static by checking the box that says "static", above the tag and layer info. It also seems to depend on the shader used; for example diffuse doesn't batch according to the stats and vertex lit does, but I don't know how accurate the stats actually are.
Answer by bigdaddio · Dec 29, 2010 at 08:51 AM
Lots of the "Rules of Thumb" seem to be based on pre 3GS hardware. I have apparently broken all the rules people have quoted many times (draw calls, 7k verts etc) and still get over 30fps on 3GS and newer hardware. Personally I ignore pre 3GS hardware, Their numbers are small and getting smaller.
You really would be best served to get signed on with Apple and get an iPod or some such. The older version of the iPod runs as well as a 3GS and the new one is apparently similar to iPhone 4.
Your answer
Follow this Question
Related Questions
Few questions about optimizing graphic performance for mobile devices. 1 Answer
Reduce Draw call for Multiple GUI Textures with same Texture 1 Answer
Help Please - Unity3D project very slow on XCode-IPhone... 1 Answer
One material Two DrawCalls 1 Answer
What are the implications of re-writing or porting a game to the iPhone? 2 Answers