Hi, I see that a lot of time is spend on evaluateActiveMeshes, so my main question is if its possible to disable it at all?
My scene itself has only one orthographic camera and a 2.5d top down view, since the view range is limited, all meshes which are shown are either in the cameras view or wouldn’t make a big difference if they are taken into account or not for rendering. I expect that 80% of the meshes will also move or change its rotation and that meshes are added/removed constantly.
I created a small playground which contains way more meshes then in my actual scene but it shows the problem I have:
What I tried:
- doNotSyncBoundingInfo = true
- alwaysSelectAsActiveMesh = true
- skipFrustumClipping = true
But I still get mesh selection time of 4ms which is for the 240fps target I have too high (I would actually expect it to be at 0ms).
Adding something like that (just testing if that would help in some way) actually removes the selection time but creates problem that sometimes the meshes disappear:
setInterval(() => {
scene.unfreezeActiveMeshes();
setTimeout(() => {
scene.freezeActiveMeshes(true, undefined, undefined, true, false);
scene.skipFrustumClipping = true;
}, 50);
}, 1000);
Am I understanding something wrong that alwaysSelectAsActiveMesh should actually reduce the time spent there by a lot since all meshes have that set?