Search Unity

Iphone4s + iphone 5 Draw Calls?

Discussion in 'iOS and tvOS' started by Deleted User, Jul 7, 2013.

  1. Deleted User

    Deleted User

    Guest

    As far as i know the iphone4 is able to take up to 40 draw calls.... is there someone who has experience with the maximum number of draw calls on newer devices like the iphone4s and iphone5?
     
    Last edited by a moderator: Jul 8, 2013
  2. Deleted User

    Deleted User

    Guest

  3. svenskefan

    svenskefan

    Joined:
    Nov 26, 2008
    Posts:
    282
    Hi!
    Unfortunately there is no such number to be found.

    How many drawcalls you can use depends on a number of different factors, such as what shaders/materials you are using, size and distribution of your meshes etc.

    Just experiment using whatever circumstances are applicable for your particular situation and adjust shaders/materials and meshes (--> drawcalls) to get a framerate you are happy with.
     
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The use of physics, script execution time and so on also apply to your good advice (just adding to it) as draw calls are a CPU operation :)
     
  5. Deleted User

    Deleted User

    Guest

    hehe! thnx to both for the sweet advice. And please don't get me wrong, but this is somehow logical when developing. At least it should be - to those who plan to develope anything xD My question was more based on how much draw calls in total the new generations of iphones are able to manage. Of course considering like svenskefan mentioed script execution time, number of sound channels, the use of mp3s or physics, which i try to avoid as good as possible :) But if we use for example only graphics to see how far a device can go, then 40 draw calls was the maximum the iphone was able to deal with, without getting any peformance losses. Now the question comes up, if someone did similar tests with the new devices. A pitty i don't have the an iphone5 anymore, since my kid was dumping it secretly into the trash bin :/
     
  6. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    @Antigollos - if you share up your test project I'll run it on an iPhone 5 for you.

    I don't recognise the number of 40 draw calls on an iPhone 4. Where did that number come from? As @svenskefan said the shaders on the meshes that those drawcalls kick off will have a major impact on the performance. Also, if those meshes have few triangles, and those triangles map to small numbers of pixels, then the bottleneck might be the speed at which the CPU can queue up drawcalls, not the rendering of them.
     
  7. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    IMHO, it all depends on what's going on in the game. As an example, with one shader (alpha test) I get 30 draw calls with 35 FPS on an iPhone 4s, but with a alpha blend shader I'm hitting 150 draw calls at 60 FPS. All depends.
     
  8. Lioncirth

    Lioncirth

    Joined:
    Apr 7, 2009
    Posts:
    111
    I originally focused hard on draw calls and keeping them down - now they dont go above 30.

    What I was not keeping an eye on were things like texture sizes and FPS etc.

    Tested my game on iPhone 4 and was hitting a FPS of 3-4! - I now think I have found the culprit and will be sorting, what I am getting at though is to not just look at draw calls and do as many tests as possible to see if something is helping or not :)
     
  9. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Small test app drawing some number of cubes, each with a unique material. An OnGUI function allows me to keep increasing the number of game objects. The profiler shows:

    ----------------------------------------
    iPhone Unity internal profiler stats:
    cpu-player> min: 22.0 max: 23.2 avg: 22.7
    cpu-ogles-drv> min: 8.1 max: 8.7 avg: 8.2
    cpu-present> min: 0.4 max: 2.3 avg: 0.7
    frametime> min: 32.5 max: 35.0 avg: 33.3
    draw-call #> min: 1195 max: 1195 avg: 1195 | batched: 0
    tris #> min: 14350 max: 14350 avg: 14350 | batched: 0
    verts #> min: 28668 max: 28668 avg: 28668 | batched: 0
    player-detail> physx: 0.2 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.0 render: 22.3 fixed-update-count: 1 .. 2
    mono-scripts> update: 0.0 fixedUpdate: 0.0 coroutines: 0.0
    mono-memory> used heap: 471040 allocated heap: 786432 max number of collections: 0 collection total duration: 0.0
    ----------------------------------------

    Which, if I am not mistaken, shows 1195 draw calls, with the app running at 30 fps. This is on an iPhone 5. I've not done anything funky:

    Code (csharp):
    1. #pragma strict
    2.  
    3. var go : GameObject;
    4.  
    5. private var cloneCount : int = 1000;
    6.  
    7. function cloner(mn:int, mx:int){
    8.     if (go) {
    9.         var cloneGO : GameObject;
    10.         var mat : Material = go.renderer.material;
    11.         for (var i : int = mn; i < mx; i++){
    12.             cloneGO = Instantiate(go);
    13.             cloneGO.renderer.material = Material(mat);
    14.             cloneGO.name = "clone" + i;
    15.         }
    16.         cloneCount = mx;
    17.     } else {
    18.         Debug.Log("Please choose a go in the inspector");
    19.     }
    20. }
    21.  
    22. function Start () {
    23.     cloner(0, cloneCount);
    24. }
    25.  
    26. function Update () {
    27.  
    28. }
    29.  
    30. function OnGUI() {
    31.     if (GUI.Button(Rect(10,10,150,50),"Add 10")){
    32.         Debug.Log("add 10");
    33.         cloner(cloneCount, cloneCount+10);
    34.     }
    35.     if (GUI.Button(Rect(10,100,150,50),"Add 100")){
    36.         Debug.Log("add 100");
    37.         cloner(cloneCount, cloneCount+100);
    38.     }
    39. }
    40.  
    Should add that I am not saying 1195 is the maximum possible number of drawcalls, just that is the number I reached trivially without having to do any work.
     
  10. Adrenaline-Crew

    Adrenaline-Crew

    Joined:
    Dec 14, 2010
    Posts:
    400
    Here is a shot from my game on iPhone 5. Works great

    $Screen Shot 2013-11-21 at 12.32.30 AM.png
     
  11. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    1.5 million tris on iphone 5?
    it can run it?
     
  12. weliketoparty

    weliketoparty

    Joined:
    Aug 17, 2011
    Posts:
    124
    It works at 60fps?
     
  13. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    (isn't that a screenshot from the editor?)