Dynamic Batching Vertex Limit

Hi,

The documents state the following:

Batching dynamic objects has certain overhead per vertex, so batching is applied only to meshes containing less than 900 vertex attributes in total.
If your shader is using Vertex Position, Normal and single UV, then you can batch up to 300 verts and if your shader is using Vertex Position, Normal, UV0, UV1 and Tangent, then only 180 verts.

So when does the 900 vertex limit apply? When only one or two of the listed three is used (vertex pos, normal or single uv)? Or when none of them is used? And if it’s none, then what can you use?

Any additional information about this vertex limit is welcome!

Thanks

Vertex attributes mean position, uv, normal, colour, etc. Count the number of attributes that you shader uses. In the example the shader uses 5 attributes, and 900/5 = 180. If you had some whacko shader that used 100 attributes, then you could only batch models that have 9 or fewer vertices.

I would use those limits as a rough guide. The docs are trying to tell you that adding more attributes to the model counts against the limit. In the inspector you can turn off tangents, etc to help reduce the amount. Any additional attributes will inflate the cost. Also the engine will tri-strip your model so the vertex count will be inflated from your 3d package. Uv seams will cause an increase too.

So what does all of this mean? This means if you are trying to get a model under the count, load it up into an empty scene in Unity and click Stats. Notice the vertex count. If it is close to 900, duplicate it and see if it batches in the Stats window. If it doesn’t rework the mesh and delete attributes and repeat the test.