- Home /
Will unity sort Drawcalls to reduce overhead ?
Okay I am operating under this assumption:
Scenario 1) If I have 2 drawcalls (object A and object B) and both are as different as they could possibly be:
different mesh different material different shader different texture maps
the overhead between these 2 objects is going to be larger than:
Scenario 2) If I had 2 drawcalls (object A and object B which is an instance/dublication of the object A prefab) which are identical:
same mesh same material same shader same texture maps
Scenario 2 is faster than scenario 1 because the graphics card doesnt need to swap out anything!
Now what I am wondering is if I had 1000 unbatched identical trees in my scene (never mind the transparency its an opaque tree trunk only) and 1000 unbatched identical rocks,
If unity rendered all 1000 trees and than all 1000 rocks that would be 2000 drawcalls that would get processed significantly faster than: if unity rendered them mixed like this:
tree,rock,tree,rock,tree,rock,tree,rock,tree,rock,tree,rock,tree,rock, and so on ... correct ?
If that is the case I would like to know if unity does any kind of internal sorting to make sure that all objects with the same material get rendered right after each other (once again I am not talking about batching !) or weather the scene hierarchy dictates the order ?! could I optimize stuff by grouping objects of the same material etc together under one transform? and how does view frustum culling factor into this ?!
Your answer
Follow this Question
Related Questions
Performance of float.CompareTo 1 Answer
Is there anyway to get Unity GUI to cache an image? 1 Answer
Can an animated object become static again? 1 Answer
How to optimize with a lot of objects 0 Answers
Strategys for reducing draw calls 3 Answers