evaluateActiveMeshes called too often?

Hi there :wave:,

we’ve been running into strange issues, at least it seems odd.

We are looking for the issue that causes the evaluateActiveMeshes function to be called this often :arrow_up: (2-7 times a frame), due to that the chain is executed too (e.g. isSynchronized and isSynchronizedWithParent). We are using BabylonJS 4.0.3, but this also appears in 4.1.

FYI: Take a look at this deep (?) scene graph

second image in comments :slight_smile:

All the information from above is without interaction, it is just the running (untouched) scene.

Hey! it could be great to try to freeze world matrices if your meshes are not moving

Also it is close to impossible to help without a repro as this could be caused by a LOT of reasons

Did you try to freeze the scene with scene.freezeActiveMeshes() ?

_evaluateActiveMeshes is called for each camera in the scene, and for each camera it is also called for each rig camera.

So it can be called multiple times within a frame if you have multiple camera/rig camera.

Also it is close to impossible to help without a repro as this could be caused by a LOT of reasons

Sadly it is not possible for me to share the repo, we are trying to reproduce the behavior with a playground but could not do it, yet.

So it can be called multiple times within a frame if you have multiple camera/rig camera.

We only got one camera.

Did you try to freeze the scene with scene.freezeActiveMeshes() ?

It helps somehow, but it feels like handling the symptoms and not fix the root cause.

Thank you for your suggestions, I understand that it is nearly impossible to help if I can’t provide you more information. I hoped that there would be some common fix or knowledge that I’m missing :sweat:

Yup the playground would definitely help here as there is no common cause I could think of.

Brute force is sometimes the only way.

  • Make a directory copy, so you do not care what happens.
  • Rip out a portion of what your scene does, jot a note of what it was, & re-profile
  • repeat until it stops.

To double check, it was not a combination of rip outs which does it.

  • Make a directory copy from the original once again
  • Rip out only the last thing ripped out from the first time.