I’m trying to understand “Frame Steps Duration” from the Inspector, in order to optimize my scene.
First, what is the “meshes selection” in the “frame steps duration” section of the inspector ?
In one of my scene, composed of hundreds of meshes (most of them are instanced) and millions of vertices, when I hide all my objects (so, 0 draw calls), I still get a non zero value in the “meshes selection”. I would like to specify that I don’t need any BJS octree optimisation or BJS selection/picking, all is done by myself (because it highly depends on the type of objects I handle).
Is there a way to vanish the value of “meshes selection” ?!
Second, even if I disable all of my objects, is there a way to improve the frame rate ? (in the screen, you can see I get 28FPS) ? Or is it a limitation due to memory consumption (nof vertices, materials, textures …) ?
There were an unwanted process during the render loop (from my side), even if nothing had to be drawn. After correct this, I now get about 45-50 FPS instead of 28 FPS.
Still in my really expensive scene with all the objects hidden, I notice that the following line takes about 10 ms to compute : this.mainScene.render(); (this line is inside my render loop)
I tried to use scene.freezeActiveMeshes(), but I think I don’t completely understand its behavior and how/where to use it.
When I use it, the value of meshes selection effectively vanishes, but the global frame time grows up, and in particular this.mainScene.render(); which now takes about 35 ms to compute.
I suppose that I should freeze/unfreeze in particular cases, but I have no idea where.
freeze will actually lock down the active meshes list (no more frustum clipping at all)
If your scene is large this may NOT be the correct optimization
maybe if your meshes are static you can freeze their world matrix? (mesh.freezeWorldMatrix())