Simple Performance Test Drawcalls

Hi All,

I’ve put together a performance simple test using Unitys built-in 2D support. I have an ortho camera, a sprite prefab and some logic that spawns more and more of the same prefab which I click on the screen, the sprites then just bounce and rotate around the screen. The sprite prefab is nothing fancy, I’m using the built-in default sprite material / renderer etc.

Sprites instances are dynamically batching but around every 700 Tris / 1400 Verts added from new sprite instances another drawcall is added. Is this intended behavior as running a similar test using other 3rd Party 2D frameworks like 2D Toolkit & Futile I drawcalls stay the same even at the higher amounts of sprites?

I’ve looked here Unity - Manual: Draw call batching but can’t see anything that applies particularity as batching is occurring just not how I thought it would at higher amounts of sprites.

Maybe I’m doing something wrong but its about as simple as it can be. Any help or education is appreciated!

Pete

From what I’ve read, each dynamic batch has a limit to the number of vertices that can be included, not only in each object being drawn (300), but for the entire batch itself (around 4000). This means that once your batch has 4000 vertices in it, all new geometry must be put into another batch, and rendered separately, thus increasing the number of draw calls.

It’s a bummer, but hopefully you won’t need more than 1000 identical sprites onscreen at once :wink:

Unity has determined that if more then a specific amount of mesh data is batched together very frequently (dynamic batching) the beaching will be so expensive that it will kill the benefit of having the the meshes batched.

If you have a other GUI / 2D framweork system and you now that you will probably not very often have to update the mesh because of cahanges , you can batch much more meshes together without loosing the batching benefit.
A few more draw-calls are not as critical but batching helps.