# Auto Thin Instances are parsing different than in a PG on the same Environment

**URL:** <https://forum.babylonjs.com/t/auto-thin-instances-are-parsing-different-than-in-a-pg-on-the-same-environment/60836>\
**Category:** Questions\
**Created:** [October 6, 2025, 9:23pm UTC](https://forum.babylonjs.com/t/auto-thin-instances-are-parsing-different-than-in-a-pg-on-the-same-environment/60836 "2025-10-06T21:23:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [October 6, 2025, 9:23pm UTC](https://forum.babylonjs.com/t/auto-thin-instances-are-parsing-different-than-in-a-pg-on-the-same-environment/60836/1 "2025-10-06T21:23:45Z")

</div>

@Evgeni_Popov This might not be enough information to go off of, but based off the conversation

> [@Automatically Convert Instances to Thin Instances?](https://forum.babylonjs.com/t/automatically-convert-instances-to-thin-instances/44236/13):
>
> Here’s a working PG: The main problem was that the glTF loader sets the mesh.overrideMaterialSideOrientation property, which takes precedence over the material.sideOrientation property, meaning the new material side orientation was not taken into account.

I had done some work for Frame where it parses our environments automatically converting the instances to thin instances. Which is working for most situations. But now we have ran into a specific setup where not matter what we do the instances will not propagate but it works perfectly in a PG.

One thing that I noticed is that the seats all come up as “Negative:Negative” in the parser in the [PG](https://playground.babylonjs.com/#0LH9I2#16),

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/8/d/8d3dcaea07a01bc63f62ab3e34b1e37d70f223a0.jpeg)

and all seem to work.

But in our Frame environment (which mind you in both the PG and in Frame the parent node has the same matrix) they come up as “Negative:Positive” which seems rather odd.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/f/3f953752b3033ee47fd24f268aaede1bec6a3fb9.jpeg)

Only the first chair and the first duplicate of the instance appear in Frame with no errors to indicate anything is going wrong.

Our artist @PaulK_Frame made some squares to test that the parser was working:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/2/724ef354f84adf5f2c78a43c96c52c708dc57cfa.jpeg)

but that resulted in the same thing!

This is rather odd, as it works in all our other environments.

I know this is not a ton of information to go off of, but any insight as to what to look into would make me most grateful. Currently I’m thinking it something with the invertedBaseMesh not property rendering its instances, it shows up itself.

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [October 7, 2025, 7:49am UTC](https://forum.babylonjs.com/t/auto-thin-instances-are-parsing-different-than-in-a-pg-on-the-same-environment/60836/2 "2025-10-07T07:49:51Z")

</div>

It looks like the world matrices could be wrong, as matrices with determinant == 0 will end up in the positive array… Can you debug it and see what the world matrices look like when you dispatch the instances in the negative/positive arrays? Also, try to call `mesh.computeWorldMatrix(true)` for all meshes to be sure their world matrix is up to date. If you have a live link somewhere, I could try to investigate further.

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [October 7, 2025, 2:42pm UTC](https://forum.babylonjs.com/t/auto-thin-instances-are-parsing-different-than-in-a-pg-on-the-same-environment/60836/3 "2025-10-07T14:42:50Z")

</div>

I can probably deploy the broken environment to beta and get you a link to that today sometime. Let me make sure nobody else needs it for a while.

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [October 7, 2025, 3:07pm UTC](https://forum.babylonjs.com/t/auto-thin-instances-are-parsing-different-than-in-a-pg-on-the-same-environment/60836/4 "2025-10-07T15:07:38Z")

</div>

> **[0.60.1](https://beta.framevr.io/pryme8?debug=true)**
>
> (Dev) Immersive presentations and meetings - right from the browser on desktop, mobile, and VR

This is the environment. If you need any more information in the logs let me know Ill have to redeploy. There is a button at the top to open the inspector.

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [October 7, 2025, 4:25pm UTC](https://forum.babylonjs.com/t/auto-thin-instances-are-parsing-different-than-in-a-pg-on-the-same-environment/60836/5 "2025-10-07T16:25:22Z")

</div>

Thanks for the link.

However, I can’t find how to set a breakpoint in Babylon.js code, as I can’t see Babylon sources in the “Sources” pane of Chrome? I tried to step into `globalThis.scene.render()` but I ended up in a wasm module…

Also, where is your code which converts all meshes to thin instances?

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [October 7, 2025, 4:44pm UTC](https://forum.babylonjs.com/t/auto-thin-instances-are-parsing-different-than-in-a-pg-on-the-same-environment/60836/6 "2025-10-07T16:44:21Z")

</div>

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/6/269bd0a4f3f9d8dc05ee7c01b198e292b222b98b.png)  
Under babylon/systems/GLTFParserSystem/EnvironmentLoader/ParserPlugins/AutoThinInstancePlugin.ts

Should have access to the source maps with the beta build.

I just also confirmed that breakpoints are working.

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [October 7, 2025, 5:38pm UTC](https://forum.babylonjs.com/t/auto-thin-instances-are-parsing-different-than-in-a-pg-on-the-same-environment/60836/7 "2025-10-07T17:38:58Z")

</div>

So, the world matrices of the meshes are incorrect: if you call `computeWorldMatrix(true)` on all meshes before looping over them in `AutoThinInstancePlugin.Parse`, it works:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/6/36cb442875d672e759756b70fba686c748a2e308.jpeg)

I’m not sure why they are wrong in the first place, though…

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [October 7, 2025, 6:50pm UTC](https://forum.babylonjs.com/t/auto-thin-instances-are-parsing-different-than-in-a-pg-on-the-same-environment/60836/8 "2025-10-07T18:50:08Z")

</div>

You did say that initially cool thank you.
