- Home /
Drawcalls or Batched, which is more important to performace?
Hello once again everyone. Busy day for me here on Unity Answers. Anyway, I have a question about performance. I have been running my game with the statistics window open and I noticed that is has a draw calls field and a batched field. Both of my numbers are high and could and should be lowered, but my question is when it comes to performance, which one should I pay more attention to? The draw calls or the batched field? And if it is batched, how do I go about lowering it?
Just for reference:
At the fastest part of my game I have 151 draw calls and 14 batched At the slowest part of my game I have ~4000 draw calls and ~9000 batched
This certainly leads me to believe that batched is the number I want to pay attention to, as even in the slow parts my FPS rises as my batched decreases.
Answer by Peter G · Jul 19, 2011 at 07:47 PM
Batched is a good thing. Batched is the number of objects that Unity combined into a single draw call. The higher that number, the more draw calls you are saving. The reason you are getting a slower frame rate is because 4000 draw calls is rather high. You want a lower draw calls and to raise the batching.
I'm still looking around for the best way to do that. I was reading up on batching and was wondering if since none of my objects in the game move, aside from the main camera, would it be beneficial to me to check the static box on them all?
Every "How do I reduce draw calls" thread I have found talks about combining meshes, but it seems Unity already does that now. So if that is the case, where is a good place to go to learn more ways to reduce draw calls or simply increase performance?
I'd be interested in that, too. but please open a new question for this. Greetz, $$anonymous$$y.
If an object doesn't move then ALWAYS mark it static
. Static batching is more efficient that dynamic batching.
Static batching occurs with all static objects that share the same material. Unity creates vertex array for all of them and they get drawn with one call.
Dynamic batching occurs with objects under 300 verts and they are batched together every frame. So it isn't nearly as beneficial as the static version, but it is still faster than adding an extra draw call.
The only other real good way to reduce the number of objects the camera has to draw. This can be done through creating fewer objects or by using Occlusion Culling. A well designed scene blocks out other parts of the scene. This lets you not draw the parts further back.
Wait a moment... I know how to mark a variable or a function as static... but how do I mark an Object as static? Greetz, $$anonymous$$y.
Your answer
Follow this Question
Related Questions
Is there any way I can statically batch procedurally generated objects? 0 Answers
,Drawing 100 000+ cubes 1 Answer
Batching draw calls? 2 Answers
Can the Cull option in shader improve perfomances ? 2 Answers
What's a good draw call count? 2 Answers