does someone have an example or explanation for the meshSubclass parameter in MergeMeshes function? Mesh | Babylon.js Documentation
We supply the function with an array of meshes, but meshSubclass only has one mesh. Do I have to understand it in a way, that I have an existing mesh and its vertex data will be overwritten by the merged mesh?
So without its use its a new mesh (immutable approach):
const mesh = MergeMeshes([mesh1, mesh2], true, true, undefined)
and with it, it will be mutated?
MergeMeshes([mesh3, mesh4], true, true, mesh)
Maybe follow up question: If I have a large mesh with many submeshes, is there an efficient way to replace a submesh even if indices of the new meshes are more than before?
I would like to reduce recalculation time for a mesh and only replace altered parts.
Partly answering it myself, looks like @Evgeni_Popov made a CompositeMesh here: Different meshes that share the same material, batching drawcalls? - #11 by Evgeni_Popov Not sure if it is fully covering my question, but seems nice.
And another thing I noticed for MergeMeshesAsync: This function uses a coroutine that needs one frame? for each VertexData type (position, color, uv…), since it yields after each one of them. I was rather expecting a function that would use another thread. Would it make sense to have such a function? Probably would need SharedArrayBuffer for faster I/O, but I also read some time ago SharedArrayBuffers dont have wide support yet. Just some thoughts…