More saved batches than actual number of batches?
Which of these stats have better performance and why? Left = 2 identical crates (unoptimized, has many meshes and matierals per crate) Right = 2 identical crates (optimized, has only 1 mesh and 1 material per crate)
I'm not understanding why the left (unoptimized) one has more saved batches than actual batches? Any help is appreciated and thanks!
Note: scene contains no lights except the default Directional Light that comes with a new scene. Crates are static in both scenarios.
Answer by Bunny83 · May 05, 2018 at 02:27 AM
The number of batches tell you the batches which are rendered. So there would be 35 additional drawcalls which got combined into those 22 batches. As you can see your batch count is actually equal to the setpass call count since you have 22 passes in the materials you're using. So each pass is only rendering a single batch. A batch can consist of multiple combined (batched) objects.
For example if you have 10 objects all using the same simple material which only has one pass (no fancy lighting, shadows, ...). If all 10 objects can be batched together you would get a single batch and you would have saved 9. Though when using the standard shader for example you get already multiple passes for a single object depending on the lighting, number of lights, if shadows should be calculated, etc.
Obviously the right one has better performance. First of all you can see that the cpu time is slightly lower. For mobile you want to keep the setpass calls as low as possible. Also having only 2 shadow casters makes the shadow rendering much more efficient. You can simply ignore "saved by batching" it's just a statistical information. The number of batches it has to render matters.
Well the number of saved draw calls may be relevant when it's over 9000. The batching process itself will consume some performance itself. However static batching is usually almost for free as it's batched only once. Dynamical batching has to be redone all the time.