Search Unity

Draw calls become weird

Discussion in 'Editor & General Support' started by thetnswe, Aug 17, 2011.

  1. thetnswe

    thetnswe

    Joined:
    Aug 23, 2010
    Posts:
    46
    Hi,
    I found out about the draw calls calculation inside Unity and I am not sure why it's happening and it looks weird to me.
    Can somebody explain why do the Unity makes more draw calls when the camera is near to the object. I have got 100s of static objects inside the game level and you can see the number of draw calls in the following pictures.

    Draw calls and poly count when the camera is near


    Draw calls and poly count when the camera is far
     
  2. cpasjuste

    cpasjuste

    Joined:
    Apr 2, 2012
    Posts:
    154
    Hi, sorry to resurrect an old thread but i do encounter the same problem with Unity 3.5.1f2 :

    I have say 10 simple cubes with the same material in my scene, so i should have only 1 draw call, and it's sometime the case, but depending of the Camera position, it can goes up to 2 or 3 ore more draw calls.

    Here is two pics :
    - first pic is 4 draw calls
    - second pic is 2 draw calls, the only change is the camera Y postion, 0.5f lower.

    I'd love to get some explanations, thanks :)



     
    Last edited: May 4, 2012
  3. cpasjuste

    cpasjuste

    Joined:
    Apr 2, 2012
    Posts:
    154
    I did found the "problem" :

    I'm using a mobile shader (VertexLit) but was targeting the PC platform in the editor. If i switch to "Android" platform and set "Graphics Emulation" to OpenGLES then draw calls are accurate.

    Thanks,
    David.