Several cameras drop fps

I use 3 universal cameras for layers:

  1. Main camera. Layer mask = 0x0fffffff
  2. Secondary camera. Layer mask = 0x10000000
  3. GUI camera. Layer mask = 0x20000000

My scene has about 3600 instance meshes.

With each additional camera the fps gets lower and lower.
The performance profiler shows that my bottleneck is scene’s method _evaluateActiveMeshes.

I see that all active meshes are iterated.

Why is there no check for belonging to a mask layer? For example, why would my GUI camera run through all the active meshes when I only have 2 UI buttons?

The check is done here Babylon.js/scene.ts at master · sebavan/Babylon.js · GitHub

And cause @Deltakosh loves perf let me add him to the thread :slight_smile:

Yes, i see this check, but maybe it should be move higher ?Babylon.js/scene.ts at master · sebavan/Babylon.js · GitHub

Do you want to do a PR of that change? Happy to review it

Hey @Vladislav_Zhidko just checking if you were able to open a PR or you need any help :smiley: