- Home /
Combining spatially separate meshes?
Let's say I have a scene with 100 green marbles and 100 red marbles. Would it make any sense to combine all the green into a single mesh and all the red into a single mesh?
First, does it make sense, and second, is there some simple way of say:
loop over marbles:
We've got another green-marble
Add it to the existing green-marble mega-mesh.
The marbles aren't going to be moving around independently. If they move it will be as an assembly anyhow (i.e. move all green marbles to the right by 10).
Answer by Tetrad · Jul 02, 2010 at 02:59 PM
It might make sense. You can set up something pretty easy with Mesh.CombineMeshes
.
I suspect that if you combine meshes every frame, though (to update individual rotation/positions of the marbles), it'll be slower than having 200 draw calls. You'll really have to just try it and compare performance numbers on your target min-spec machine.
Answer by Jessy · Jul 02, 2010 at 10:16 PM
Unity 3's batching should solve this for you if the vertex count of the marbles isn't too high.