there are 20,000 cubes in my Block Model, and I used the instance to optimize it but I need much more optimization to get the smooth rendering,
here is my PG: https://www.babylonjs-playground.com/#ZEZLAT#51
is it any way to improve it?
There are a lot of ways how and where optimize your scene for the smooth view.
Did you try any of optimization hints which are described here? - Optimizing Your Scene | Babylon.js Documentation
Hi @labris
Thank you for your recommend , I use all of the method in documentation, but I couldn’t get the desire speed. there is one important limitation in my Model, which I need all the cubes bounding boxes, and I should render about 20,000 cubes with their bounding boxes. I used the instance to improve the model, but it’s not enough. its only works smooth for less than 6000 cubes.
I suppose you have very special application.
If there are no ways to reduce the number of meshes (which is the main bottleneck) you may try to limit render framerate.
So, you managed to smooth render about 6000 cubes; if you will render them only every 4th frame, you should be able to have quite smooth render for about 24 000 cubes.
Hi @Necips, Thanks a lot for your recommend , but I didn’t understand how can I calculate the data beforehand.
In my model I get the data with the json file, and how can I calculate it beforehand. is it possible to give me some hint how can I do it?
Here are some hints for so called Object Pool - Object Pool · Optimization Patterns · Game Programming Patterns
They don’t relate to JS or Babylon directly, but to know all these tips is very useful because they explain the logic inside your application.
Maybe try using LOD to change the cubes to a lower detail mesh, e.g a plane at a certain distance. Or to not render them completely if far enough. Check this link
I don’t know your application much, but I know that Thin Instances can definitely handle 20,000 easily. You will lose bounding boxes, but I guess you would have to write more code to make up for that.