Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

What are Draw calls

Discussion in 'Editor & General Support' started by raviraj_vdy, Jul 29, 2009.

  1. raviraj_vdy

    raviraj_vdy

    Joined:
    May 14, 2009
    Posts:
    309
    Hi guys

    I want to know what are "Draw Calls", what are they related to how to calculate Draw Calls.

    thanx
     
  2. Spacemonkey

    Spacemonkey

    Joined:
    Oct 24, 2008
    Posts:
    89
    Draw calls = how many objects are being drawn to the screen. You want to keep this number down to maintain good performance, so watch out for pixel lights as they make objects get drawn as many times as there are lights affecting them. Use the Rendering statistics window in the editor to get the number of draw calls.
     
  3. pete

    pete

    Joined:
    Jul 21, 2005
    Posts:
    1,647
    to clarify... actually each material in an object drawn to screen. ie an object with 1 material = 1 draw call, an object with 4 mats = 4 draw calls. lights, shadows etc all add on top of that.
     
  4. raviraj_vdy

    raviraj_vdy

    Joined:
    May 14, 2009
    Posts:
    309
    Hey guys

    Thank you for the help :)

    So the Draw calls depend on number of materials being used in a scene the no of objects being rendered with materials applied on them.

    thank you again
     
  5. raviraj_vdy

    raviraj_vdy

    Joined:
    May 14, 2009
    Posts:
    309
    hey Spacemonkey

    One thing though

    i didn't find the "Rendering statistics window in the editor" that you are talking about.

    can you pls tell me were can i find it?

    thanks
     
  6. HJP

    HJP

    Joined:
    Jul 8, 2009
    Posts:
    152
    May I perhaps help? You can found it there:

     
  7. raviraj_vdy

    raviraj_vdy

    Joined:
    May 14, 2009
    Posts:
    309
    Hi HJP

    :oops:

    I didn't check there

    Thanks dude
     
  8. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    While draw calls can be a bottleneck, remember that frame rate is king. If your frame rate is fine, don't worry about draw calls. The number of draw calls required to severely impact performance depends heavily on the hardware in question, and everything else that is being done every frame.
     
    KUFgoddess likes this.
  9. sotirosn

    sotirosn

    Joined:
    Jan 5, 2013
    Posts:
    24
    I know this thread is old but how many draw calls is ok? Right now I am doing over 200 with glass effects and refraction, I develop on pretty nice Mac so I would like to know what can an average computer do?
     
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Basically, you know how many draw calls based on your target hardware. We can't ever tell you what that is. People here have machines that will obliterate your target audience's machines. What do you target? get that machine, and figure it out, or do some good beta tests.

    To clarify on Spacemonkey's post: no, draw calls are not necessarily how many objects are being drawn on screen. Because low poly objects which share the same material and scale potentially could get batched using Unity's Dynamic Batching.

    You might ultimately find an average computer is faster than your mac. Your mac might have a better gpu and a worse cpu. Or it might have a worse gpu and a better cpu. Or pigs might fly. I don't see 200 being a lot for desktop though.
     
    Last edited: Oct 5, 2013
  11. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    Static or dynamic batching is combining the objects so you get less draw calls in total.
     
  12. Malakina

    Malakina

    Joined:
    Jul 11, 2014
    Posts:
    5
    I'm trying to collect data on how the hardware gets affected by these stats.. you say the performance deffers depending on the hardware, but how do the draw calls for example effect the GPU and the CPU? I find it hard to even find data about if a draw call for example only affects the GPU or also the CPU and in which proportions
     
    sj631 likes this.
  13. Fornoreason1000

    Fornoreason1000

    Joined:
    Jul 14, 2012
    Posts:
    29
    if you have pro you could use the profile then check which is more affected by when you turn on and off the objects you are rendering... it won't be accurate data but it will give you an idea...
     
  14. joebryanart

    joebryanart

    Joined:
    Sep 18, 2014
    Posts:
    2
    The image has been deleted, D:

    EDIT: ah i found it nevermind :p
     
  15. SwornAx

    SwornAx

    Joined:
    Jul 22, 2015
    Posts:
    2
    Hi,
    Would anyone tell me about the impact of quality of textures and materials on draw calls?
    I want to say that if we reduce quality of textures or materials, will it decrease draw calls?
     
  16. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You should really do a search because there's probably more than 500 topics that cover this, including the manual. I'm not really in the habit of constantly repeating myself but changing a material settings will often result in a "new" material, so yeah, more draw calls.

    But it's something you need to properly read up instead of just asking because it's a grey area.