Batching models over 300 vertices?

Is there a way to batch objects with more than 300 vertices. Because I got my enemies down to 300, but when I UV mapped the enemy, the vertices went up to around 900. Is there a way to UV map without having the vertices count go up, or is there a way to batch objects with more than 300 vertices if they all share the same mesh and textures?

only if you write your own batching code.

on unity desktop 2.x there is no batching anyway though

Yeah, I’m working with Unity iPhone, and thinking back should probably have put it in that section. But how would I go about writing my own batching code? Is there a link to Unity3d’s batching code that I could kind of work off of or is there an example or anything? Thanks.

No, aside from UT raising the 300 vertex limit, which isn’t likely to happen because dynamic batching is not free. It’s only faster than separate draw calls as long as there is a limit on the number of vertices, otherwise the time it takes to do dynamic batching would be slower than just having separate draw calls in the first place.

It’s unlikely UV mapping would triple the number of vertices. Make sure you aren’t using pixel lights in the editor.

–Eric

Ok thanks. I’ll check on the lighting.

EDIT: Looked at the lighting, it’s set to Forced Vertex so I have no idea. Do you have any idea why my model might have done that?

How many materials are on the objects? For best results you’d want one material with one UV. If you have the object broken up into multiple materials, it may double/tripple the processed vertexes. I think it has something to do with submeshes.

I have two materials on my object, I’ll get rid of one of those and see if that makes a difference.

Aside from not using one material, vertices need to be split on UV seams, but if there are no UV seams, then the vertex count won’t increase.

For example, a plane made of 2x2 quads will have 9 vertices if it’s just mapped as a single square:

If you move the UV mapping of each quad around so that it’s no longer a single contiguous square, then it will become 16 vertices:

If you triangulate it and move the UV mapping of each tri, then it will become 24 vertices:

So basically try to keep UV mapping as contiguous as possible.

–Eric

1 Like

Eric, I wish you wrote the documentation

LOL I agree :smile: