x


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.

more ▼

asked Jul 19 '11 at 07:38 PM

dibonaj gravatar image

dibonaj
233 13 17 17

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Jul 19 '11 at 07:47 PM

Peter G gravatar image

Peter G
15k 16 44 136

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?

Jul 19 '11 at 07:50 PM dibonaj

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?

Jul 19 '11 at 08:29 PM dibonaj

I'd be interested in that, too. but please open a new question for this. Greetz, Ky.

Jul 19 '11 at 09:15 PM SisterKy

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.

Jul 20 '11 at 01:53 AM Peter G

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, Ky.

Jul 20 '11 at 11:52 AM SisterKy
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x662
x472
x336
x115
x110

asked: Jul 19 '11 at 07:38 PM

Seen: 3852 times

Last Updated: Aug 16 '12 at 07:41 PM