Use csg and mergeMesh in webworker

Hello,

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.

Do you have an idea how to solve this?

Best

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

1 Like

Thanks @Raggar. This is exactly what I was looking for.

Unfortunately it didn’t improve the performance of csg. It makes it even slower. The csg process went up from 500ms to 1800ms.

Am I missing something? Or is there another option to improve csg performance?