Hi. I’m having a big problem with dynamic batching and I don’t understand why. Some of my objects are getting batched, and some are not.
I am using Sprite Manager 2 in my project. In the example below, I am using 2 materials. Each box outlines the object with the identical materials and thus should be getting batched.
Unfortunately, that is not the case. Some things are batching and some are not, and it doesn’t make any sense why that would be. The objects are getting batched like below.
I am getting 5 Draw calls, 8 Batched. I should be getting 2 Draw calls, 10 Batched. What could cause some of these to not batch?
I am also using EZ GUI for my gui items. They do not seem to be batching either. In the example below all the items use the same material and all the text uses the same font/material. SO I should be getting 2 Draw calls, one for the text items and another for the others. But instead I am getting 7 Draw Calls, 0 Batched.
This also makes no sense to me. I really don’t think I’m doing anything wrong. Is dynamic batching supposed to be working 100% in the current release?
Yeah, I’m positive I didn’t change any values in script.In fact, I removed all my, scripts attached to any objects and it still acts the same
But I think I just figured it out. I’m just not sure if it’s a bug or just the way dynamic batching works
not all objects have the same local scale. if i change it so they all have a scale of 1,1,1 everything seems to batch correctly. Is that a limitation of dynamic batching that they need to have the same local scale or is that a bug?
That’s partly correct only : objects do batch when scaled differently when they are not UNIFORMLY scaled. It seems Unity handles differently uniformly and non uniformly scaled objects (GPU or CPU handled ?). I am afraid this optimization is quite inefficient when it is the cause of a massive increase of draw calls.
in your screenshot it looks like you use some unity text with ongui or GUIText. These wont batch. You will get 1 drawcall for each guitext object. There is only 2 ways to get around that.
A. Use 3D text (which you probably dont want)
B. have all those texts in a texture an put that on geometrie (which you most likly also dont want.)
and C.
Set up your complete GUI in xcode as a UIView and layer that on top of unity. (Which you probably also dont want to do.)