Layer masking and performance

Currently I am trying to speedup my scene, with around 70k total meshes, 30k active meshes I get around 10 FPS. I am playing around with layer masking to decrease the number of active meshes since some of these meshes tend to lie over each other. After layer masking I get around 20k active meshes, however it seems as though for large scenes the FPS are roughly the same and intuitively I would assume that less active meshes means I should have achieved some kind of speedup. I get that with layer masking the instances are still present just not visible for the camera so I thought them not being visible = less rendering. Do the active meshes not have an impact on performance? Is there something else I can do instead of layer masking to avoid rendering meshes that are not actually visible due to being below another mesh or do they not get rendered anyhow?

Hello :slight_smile:

by “active” do you mean you used Mesh.isEnabled or Mesh.isVisible ?


I would be curious to see your 70k meshes scene, by the way :grin:
Depending on the case, I would say there is a lot to discuss when it comes to optimization with a LOT of meshes… (LOD, SolidParticleSystem, etc…)

++
Tricotou

2 Likes

We have a dedicated page for it, you might find something there that will be helpful:

Optimizing Your Scene | Babylon.js Documentation (babylonjs.com)

1 Like

With active I mean the number in the babylon inspector. In the performance viewer there is a metric called active meshes (truth be told im not sure what this refers to in terms of babylon properties).

Unfortunately it is a company related issue so I cant show it publicly sorry :sweat_smile:

LOD we already have and it improved it a lot. Im not sure if a SolidParticleSystem would work since we still have to interact with the meshes by click.