since csg and mergeMesh need some time for computation I think about improving the speed. My plan is to calculate everything in a web worker but that doesn’t work easily because I can’t pass the meshes to the worker.
Here is an example of sending an array of meshes to a worker, merging them and sending the result back to the main thread using Serialization: https://playground.babylonjs.com/#0U9GQJ
Making multiple calls to postmessage to webworker is not really efficient.
The transfert is more efficient when you can use ArrayBuffer type data to transfer.
Using serialisation is very time consuming .
Only use one webworker.
I don’t really know your application, but it will be efficient if you can transfer in oneshot all the data to compute in batch . (like a work queue) and then give back results when done (once…).