Simplify skipping active mesh calculation

We have a scene with 200+ meshes that are all almost always within the view frustum. We also need to actively add and remove meshes during the game round.

Right now, evaulateActiveMeshes is taking around 40% of our frame CPU. I’ve implemented a rather dirty solution to unfreeze/freeze active meshes, set alwaysSelectAsActiveMesh and dispatchAllSubMeshesOfActiveMeshes. It kind of works, but it also a fragile solution. Is there anyway to put BabylonJS into a ‘assume you render everything every frame’ to avoid all this manual management of properties?

If you can “pre-add” those meshes you must add/remove, you can try:


Note that this means you can’t “deactivate” any mesh again before calling scene.unfreezeActiveMeshes(); but you can still just (be hacky and) move it off screen,

mesh.position.y = 100000;