# GLB file not displaying correctly in BabylonJS after exporting from Substance Painter

**URL:** <https://forum.babylonjs.com/t/glb-file-not-displaying-correctly-in-babylonjs-after-exporting-from-substance-painter/58231>\
**Category:** Questions\
**Created:** [May 4, 2025, 8:22am UTC](https://forum.babylonjs.com/t/glb-file-not-displaying-correctly-in-babylonjs-after-exporting-from-substance-painter/58231 "2025-05-04T08:22:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmhosein.hp](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mmhosein.hp/32/46314_2.png) [@mmhosein.hp](https://forum.babylonjs.com/u/mmhosein.hp)\
**Post date:** [May 4, 2025, 8:22am UTC](https://forum.babylonjs.com/t/glb-file-not-displaying-correctly-in-babylonjs-after-exporting-from-substance-painter/58231/1 "2025-05-04T08:22:56Z")

</div>

Hi everyone,

I have a 3D model in `.fbx` format. When I export it to `.gltf` and load it in BabylonJS, everything displays correctly

Later, I modified the material using **Substance Painter** and exported the model as `.glb`. The new `.glb` file does not display correctly in BabylonJS.

Problem is with the **tree branches** :  
Although the branches are correctly placed inside the leaves in the model, \*\*BabylonJS renders them visibly \*\*, making them appear incorrect:

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

However, it displays just fine on other viewers and they are hidden properly behind the leaves (like [glTF Sample Viewer](https://github.khronos.org/glTF-Sample-Viewer-Release)):

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

What could be causing this issue?  
Is there something I need to change in BabylonJS or in the export settings from Substance Painter?

Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [May 4, 2025, 12:07pm UTC](https://forum.babylonjs.com/t/glb-file-not-displaying-correctly-in-babylonjs-after-exporting-from-substance-painter/58231/2 "2025-05-04T12:07:46Z")

</div>

No chance to share the model to have a look?  
I feel this may be related to negative scaling, but it is only a guess.

---

<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:** [May 5, 2025, 9:47am UTC](https://forum.babylonjs.com/t/glb-file-not-displaying-correctly-in-babylonjs-after-exporting-from-substance-painter/58231/3 "2025-05-05T09:47:57Z")

</div>

It could also be because the material is considered as transparent for some reasons.

---

<div class="post-metadata">

**Author:** ![yamaciller](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/yamaciller/32/21810_2.png) [@yamaciller](https://forum.babylonjs.com/u/yamaciller)\
**Post date:** [May 5, 2025, 12:47pm UTC](https://forum.babylonjs.com/t/glb-file-not-displaying-correctly-in-babylonjs-after-exporting-from-substance-painter/58231/4 "2025-05-05T12:47:13Z")

</div>

If I remember correctly (or not 🤪), at some point had some similar issue from blender, while exporting a material which used an ALBEDO texture with alpha channel (in the node).  
So the GLTF material was set to transparent and then there was the sorting issue, which looks like that.  
Be sure, that there is no ALPHA (transparency) information (or the correct one) exported into the material.  
You can check the file using the INSPECTOR in the sandbox, there u should see the material properites.  
So its probably an export or substance painter “feature” rather an babylon one, I guess.

Best. Werner

---

<div class="post-metadata">

**Author:** ![mmhosein.hp](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mmhosein.hp/32/46314_2.png) [@mmhosein.hp](https://forum.babylonjs.com/u/mmhosein.hp)\
**Post date:** [May 5, 2025, 5:12pm UTC](https://forum.babylonjs.com/t/glb-file-not-displaying-correctly-in-babylonjs-after-exporting-from-substance-painter/58231/5 "2025-05-05T17:12:16Z")

</div>

[PBR - Metallic Roughness Alpha-blend.zip](https://forum.babylonjs.com/uploads/short-url/5wYnmz9Egbv4pyhx08chfNwG9Ou.zip) (3.4 MB)

It renders correctly on the glTF Sample Viewer:

> **[glTF Sample Viewer](https://github.khronos.org/glTF-Sample-Viewer-Release/)**
>
> The official glTF sample viewer

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [May 5, 2025, 7:27pm UTC](https://forum.babylonjs.com/t/glb-file-not-displaying-correctly-in-babylonjs-after-exporting-from-substance-painter/58231/6 "2025-05-05T19:27:27Z")

</div>

The same issue happens in other GLTF/GLB viewers, like [https://gltf.report/](https://gltf.report/) or Google [Model Editor](https://modelviewer.dev/editor/)  
I believe the difference in [glTF Sample Viewer](https://github.khronos.org/glTF-Sample-Viewer-Release/) is related to the depth calculations. You will get the same result if enable depth prepass for the material

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/9/2/926d9fa828bbd48d8edd16e1643e6c7d79a4c198.jpeg)

The matter is that this is not the most effective solution.  
In the GLB file which is exported from Substance 3D Painter the transparency mode for “leaves” material is set to Alpha Blend mode. It also uses alpha from non-transparent texture which is nonsense. To get stable results just change the mode to Opaque and all issues will go away.

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

Below is the short info about Alpha Blend (Transparency Blending) mode which clearly shows that there is no reason to use this mode for non-transparent objects.

- **What it does** :
  - Combines the color of a pixel with the background using its **alpha value** (0–1).
  - Allows for **partial transparency** (e.g., glass, smoke, water).
  - Requires rendering objects in **back-to-front order** (depth sorting).

- **Use Cases** :
  - Glass, liquids, or translucent materials.
  - Particle effects (e.g., fire, fog).

- **Pros** :
  - Smooth gradients and realistic transparency.
  - Works well for effects requiring depth perception.

- **Cons** :
  - Performance overhead (blending requires depth sorting).
  - Artifacts if overlapping transparent objects are not sorted correctly - your case.
