Using Octree and GLTF


Previously I used babylon as a format for my 3d models. I am in the process of testing with GLTF models.
I have used Octree so far to get good performance with the Babylon format.
Now with GLTF, if I keep Octree sometimes the character disappears when I move on a terrain (I can see the shadow still with the frozen character, but not the character)

So I tried to remove Octrees and that corrects the problem well and in addition the performance is still there as if I no longer needed Octree.

My question is therefore are Octree and GLTF compatible, that we no longer need them, or is there a bug ?

I also notice that with GLTF I no longer need :

BABYLON.SceneLoader.CleanBoneMatrixWeights = true;
BABYLON.Animation.AllowMatricesInterpolation = true;


Is this normal ?

GLTF is brand new to me and I’m starting to like it, but there are a lot of questions I still have.

Thank you.

Octrees should be compatible with GLTF, as they’re just a space partitioning technique. Would you be able to share a playground example of it not working?

For the other questions, I’ll cc our expert @bghgary

Ok, I figured out what was wrong with Octree. I used higher values:
scene.createOrUpdateSelectionOctree(68, 8);

But if I leave the default values, it works fine.

Hmmm a depth of 8 is quite high (the default is 2, and depth grows exponentially), so that might be related.

With the character model in babylon format, I had no problem with depth at 8.
If I put a value below, I fell around 45 fps and with depth at 8, I returned to 60 fps.
On the other hand with GLTF I almost no longer need Octree and I am at 60 fps. This seems to be a more optimize format. To do with my future tests. But GLTF is starting to appeal to me.

Yes, this is normal. glTF is strictly specified and the loader will do the right thing.

1 Like

That’s great then. I like GLTF after testing. File lighter, less greedy in resources…



I thought the octree problem was solved, but actually not.

This happens when there is a lot of mesh in the ground. More than 700 around. and that I move my GLTF animate character. This happens when I turn the cameraRotative. the character disappears then reappears. This didn’t happen with an object in babylon format, it seems to link to GLTF format, but I can’t tell you why.

I don’t know how to reproduce it in a PG because it looks random and anywhere on a large 1000*1000 land with 500 cube and 200 GLTF animate characters.

In fact I test the performances to know how many characters to animate my scene can contain until my fps reaches 30.

If you have a PG with a repro, then I can investigate. I’m guessing it’s related to the skinned mesh bounding box.

I tried to make a PG, but I can’t reproduce it.
I just tried again on my project and the same thing I do not reproduce it.
It seems quite random and I don’t know how I can reproduce. Even on my project sometimes I don’t reproduce it anymore

I saw that I was using this line. could this be causing this problem?
scene.blockfreeActiveMeshesAndRenderingGroups = true;

I’m sorry for not being able to recreate the problem, it’s too random. Sometimes I have the impression that it doesn’t do it anymore and then it comes back without really understanding why.

But if one day I understand better I will come back.


Okay, let us know.

this only impacts mesh disposal so I do not think so.