Activating MSFT_lod swaps x and z?

We are using a custom glTF pipeline to render pointclouds (not even babylonjs) but use the babylonjs sandbox to crosscheck and it has been an absolutely invaluable tool so far :smiley: . Suddenly (as in last month or so it was still working?!) it seems that something broke in babylonjs.

This is how babylonjs renders my testfile when LOD is activated. Note that I activated the camera that came from the glTF file. Also I increased the point size in the standard material to see something. I have hidden all LODs to make sure that it is really showing the base asset only.

The red cone is placed left of the blue cone.

Now reloading the same file after disabling the MSFT_lod extension (again point size increased and glTF cam activated) I see the expected result. (Screenshot in a reply as I am only allowed to upload one image :D)

The glTF file: aa-babylonjs-test.gltf · GitHub

Expected result:

Adding @CraigFeldspar as it may be related to the support of screen coverage added lately.

1 Like

Hi @mop and welcome to the forum.

After a few tests, I realized this is a bug in the MSFT loader itself. It was introduced recently because we now actually load and serve all LOD levels, instead of replacing them like we used to.

As you can see on your screenshot, the node tree changes when we have LODs :

Here is without LODs : Capture
Your node is correctly under the _root_ of the gltf object.

Now with LODs : capture2.
LOD meshes are incorrectly unparented.

We use the _root_ object wrapper to correct for right-handed to left-handed convention conversion. So, this node has a rotation : capture3

Which is not applied when parenting is not correct.

This looks pretty simple to fix, so I will draft something shortly, stay tuned to this forum post, and we’ll notify you when a nightly build with the fix is deployed.


Adding @bghgary

1 Like

@CraigFeldspar will do a PR tomorrow :slight_smile: THANKS a LOT !!!

1 Like

Should be okay with adding parent assign call when loading LODs with MSFT ext by CraigFeldspar · Pull Request #11083 · BabylonJS/Babylon.js · GitHub