Triangle count increased 3x after Mesh.CombineMeshes.

I decided to try to combine meshes together during start up to reduce the batch count. I was able to reduce my batch count by almost 50% by combining the meshes using the script similar to this:

But now that numerous meshes are combined, this results in an original triangle count of 4M to be increased to 12M. I assume this is because the entire combined mesh is drawn at once?

Is this to be expected? Or could it indicate an issue with my combine process?
(I verified that the original uncombined meshes are not being rendered, so that won’t influence the triangles).
In fact, I delete the original uncombined mesh using Destroy(), after the combine.

Thanks.

h


We’d need to see your full script to be sure but one thing is you should completely remove the call to new Mesh() in the code, this is actually a memory leak.

Also make sure you call the usual after creating the mesh (you’re probably already doing this)

        mFilter.mesh.RecalculateBounds();
        mFilter.mesh.RecalculateNormals();
        mFilter.mesh.Optimize();

I’ll be honest I’ve never paid attention to the Tris count, only to the number of batches so I might be facing the exact same problem. I’ll take a look tonight when I get home.

1 Like

Thanks for the info. Ill try to do what you sugges, currently I am not. There is actually another question from years ago I found, it might be related to this:
http://answers.unity3d.com/questions/502700/index.html?sort=oldest
It looks like it was never resolved.
There is an asset in the store to help accomplish theese combines. I wonder if its worth getting/
Im starting to wonder if the triangle count shown in the statistics windows is actually accurate for combined meshes.