I am working on a project that can have very large mesh counts (at now for about 2500 but expected to have more in the future). Every mesh may have different shapes and dimensions which means that I cannot use instance. So, I decided to use if there are other solutions for me to optimize the scene.
I am now having at max 2500 drawcalls (since I don’t need always show them all) about 10 materials, 1 light and no textures. I am experiencing about only 20 frames per second.
To make the problem feel clear, I would like to do a brief introduction on my project and how I have done till now to try to fix the problem:
It is a simulation project (digital twin) that can connect to real world situations. Because of that, I will have to do a lot of calculation on the position and rotation on the coordinate to make it work in BJS. Currently I found that the TransformNode.lookAt() and TransformNode.rotate() takes a lot of time to compute.
You can see that it is doing a lot of computeWorldMatrix.
So, I decided to make these functions to be called at a web worker. However, this seems does not to work when I pass anything inside BJS to the webworker(e.g., TransformNode or Vector3). And at here, I notice that the performance issue may not related to the calculation, since it was stuck at the same framerate no matter I do the calculation or not.
Then I went to the documentation of optimizing the scene, (Optimizing Your Scene | Not updating the bounding info). By adding
mesh.doNotSyncBoundingInfo = true;My scene looks really weird like this:
What it normally shows is this:
You can see that some of the meshes can be disappeared.
Does anybody have ideas on this?