- Home /
Combining Meshes
I am in the process of optimizing a game and I am seeing a lot of createVBO calls as well as a higher number of VBOs than I would expect. I have been looking into combining meshes to help solve these issues, but I have some questions about how this works.
Reading the Unity documentation on combining meshes it sounds like it is only really used for meshes which don't move, rotate, or scale.
Is this true?
Is there a way for me to combine dynamic meshes?
When I have Dynamic batching enabled for iOS shouldn't it batch meshes which share the same material automatically?
EDIT It turns out that editing meshes directly (meaning changing verts, normals, uvs, etc.) causes unity to recreate the object's VBO which is slow. So this kind of thing should not be done except during initialization.
Answer by sneftel · Apr 29, 2011 at 09:55 PM
Meshes which are moving relative to each other can't be straightforwardly combined, because different vertices are being transformed by different transformation matrices. Dynamic batching happens automatically, but only for very low-poly meshes, because of the overhead of dynamic batching large numbers of vertices.
How many VBOs are you seeing? On the whole it's better to have fewer, but it's not the most crucial element of performance in most scenes.
I have about 100 VBOs at any given time, but my scene is very simple. $$anonymous$$ost of my meshes are below 300 polys (which according to documentation is the limit), but I'm not seeing as much batching as I would expect.
The limit is 300 vertices, not 300 polygons. And that takes vertex duplication into account -- that is, it's what Unity says your vertex count is, not what $$anonymous$$ax/$$anonymous$$aya says it is.
right, sorry. But my meshes are still well under that limit.
try to create Vector3 array, set it to mesh vertices, and apply it to the gameObject, you want to know, how many verices it has.
Your answer
Follow this Question
Related Questions
My player swipes faster on iOS then android 1 Answer
How to Smooth X Axis Movement on Mobile Devices? 2 Answers
iOS performance: Mesh.DrawVBO counts 0 Answers
Unity as a Library iOS combine Target SDKs (device & simulator) 0 Answers
Combining Mesh at Runtime via Script causes temporary FPS drop 1 Answer