Strange behavior with batching

Hi,

I’ve been trying to batch objects and I am getting strange results and I do not understand why.

I have noticed that Unity does not seem to batch objects with more than 158 vertices. I’ve posted a thread in the support section of the forum about that yesterday, but did not get any replies yet.

http://forum.unity3d.com/threads/69352-Batching-does-not-occur-for-objects-with-more-than-158-vertices.

I now have another problem.

I’ve tested the batching with cubes created in the editor and it seems to work correctly. Each object generates only one draw call, and all the other instances are batched together.

The problem is that when I use a mesh that I have created in Max (a simple sphere with 140 vertices, and instantiate it, the following occurs:

1 sphere: 2 draw calls
2 spheres: 2 draw calls - 2 batched
3 spheres: 3 draw calls - 2 batched
4 spheres: 3 draw calls - 4 batched
5 spheres: 4 draw calls - 4 batched
6 spheres: 4 draw calls - 6 batched

And so on…

I’ve tried exporting a simple cube from Max and it’s working properly as well. All the objects are using the same material.

I really don’t understand what’s going on.

Anybody would have any idea of what I’m doing wrong here?

Thanks!

as i understand - you added this post before i answered in the thread about 158 vertices. Is this problem still valid?

Please submit a bug-report with your test project attached. It is very hard to say anything just based on the screenshots.

It it much more complicated now than it was before. Now dynamic batching takes both number of vertices AND size of the vertex into account. If you have “fat” vertices then less of them can be batched. Size of the vertex depends both on the geometry you’re importing (how many UV coordinates it has, if per-vertex color is set etc) and what vertex components are actually being used at run-time.

I am having this same problem ish. My max batch size is 512 verts or so…is that normal?

never mind…i saw the other threads this one was related to and it answered my questions… looks like 3*300 for a batch of verts with just pos only.