Is there anything special that a BatchedMesh does performance-wise that I couldn’t just do with several InstancedMeshes that share a Material?
For example, let’s say I create a BatchedMesh and add 3 different geometries to it: a cube, a sphere, and a pyramid. I then create 10 instances of each geometry, so the total number of instances in the BatchedMesh is 30.
Now let’s say I create 3 different InstancedMeshes: one for the cube, one for the sphere, and one for the pyramid. I then add 10 instances to each InstancedMesh for a total of 30 instances across 3 InstancedMeshes.
What are the differences between the two scenarios? Is one more performant than the other?
not sure they are difference
but with BatchedMesh you can control different object in same way.
like a forest you have different tree but all should start from ground.
BatchedMesh uses special WebGL extension called multi_draw. If it is not available, BatchedMesh would fall back to loops. So, I’d expect that there should be difference in performance if your hardware supports multidrawing.
However, there is another difference – convenience. BatchedMesh provides unified id and access to meshes. If you simulate with a set of instanced meshes for different geometries, if you need to work with specific mesh, you have to manually track in which instanced mesh it is and what is its id there.
I think there are other differences, e.g. frustum culling, which for instanced mesh is a kind of all-or-nothing, while in batched mesh is individual.
But if your main question is only about performance, would you make a test and post here the results of the test?