# Textures upside down on glb export

**URL:** <https://forum.babylonjs.com/t/textures-upside-down-on-glb-export/24041>\
**Category:** Bugs\
**Tags:** exporter\
**Created:** [September 23, 2021, 10:06pm UTC](https://forum.babylonjs.com/t/textures-upside-down-on-glb-export/24041 "2021-09-23T22:06:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen\_Friend](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/stephen_friend/32/18828_2.png) [@Stephen\_Friend](https://forum.babylonjs.com/u/Stephen_Friend)\
**Post date:** [September 23, 2021, 10:06pm UTC](https://forum.babylonjs.com/t/textures-upside-down-on-glb-export/24041/1 "2021-09-23T22:06:27Z")

</div>

Please see the original at

[Henry 8th Wives](https://www.genealogy.art/introduction.Vector_Graphics_Charts.lazy_02_Mapel_Chart%20Henry%208th.html)

When I export this as a GLB using  
BABYLON.GLTF2Export.GLBAsync(this.scene, filename).then((glb) =\> {  
glb.downloadFiles();  
});

the textures are upside down, on rotatedProcessing: fileName.glb…

 ![upside_down](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/9/c/9c8e58b09eb61683bb32f66b6d6133767e836178.jpeg)

looks like a defect  
can it be fixed?

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [September 23, 2021, 10:16pm UTC](https://forum.babylonjs.com/t/textures-upside-down-on-glb-export/24041/2 "2021-09-23T22:16:26Z")

</div>

adding @bghgary

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [September 24, 2021, 3:00pm UTC](https://forum.babylonjs.com/t/textures-upside-down-on-glb-export/24041/3 "2021-09-24T15:00:26Z")

</div>

I am not able to repro it with simple meshes in the playground :-), could you create a repro in the playground ? with let s say only one of your boxes ?

---

<div class="post-metadata">

**Author:** ![nogalo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nogalo/32/120_2.png) [@nogalo](https://forum.babylonjs.com/u/nogalo)\
**Post date:** [September 24, 2021, 5:23pm UTC](https://forum.babylonjs.com/t/textures-upside-down-on-glb-export/24041/4 "2021-09-24T17:23:32Z")

</div>

I feel like this is the same issue I dealt with some time ago. Look into this thread, and maybe it helps you figure out what’s going on.

> [@3dsMax exporter plugin, GLTF/GLB](https://forum.babylonjs.com/t/3dsmax-exporter-plugin-gltf-glb/6492/13):
>
> [https://www.babylonjs-playground.com/#YIU90M#163](https://www.babylonjs-playground.com/#YIU90M#163) So as I mentioned before, initially if I export a model in glb with the texture it looks okay. But if I try to use that same texture and apply it to the existing material, suddenly it looks wrong, like UVs are messed up. You can see in the PG that it looks okay initially. Uncomment line 21 to assign new texture (same texture basically). you can try to load the babylon version of this (uncomment line 11 and mat2), and you can see that it doesn’t…

So basically as I understand it’s due to OpenGL vs DirectX conventions I guess (so (0,0) coordinates being left top vs left bottom). So basically, if you are loading texture manually in the code, the solution to above thread should work for you as well (last parameter “false” indicates that you want to flip the texture vertically aka **invertY** ). Now, I am not exactly sure what to do when you export the GLB file with embedded texture. Is there a property like **myTexture.invertY = true**??. I did a really little bit of research and couldn’t find it. So you can look into that. Alternatively, scaling the texture with negative value could be workaround. So something like

> \*_myTexture.vScale = -1_

Here it is in action:

> **[Babylon.js Playground](https://www.babylonjs-playground.com/#YCRC7U)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![nogalo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nogalo/32/120_2.png) [@nogalo](https://forum.babylonjs.com/u/nogalo)\
**Post date:** [September 24, 2021, 5:26pm UTC](https://forum.babylonjs.com/t/textures-upside-down-on-glb-export/24041/5 "2021-09-24T17:26:30Z")

</div>

Oh, sorry. I think I missed the idea of what are you doing and trying to achieve. My answer might not be helpful. But I will leave it, just in case.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [September 24, 2021, 5:31pm UTC](https://forum.babylonjs.com/t/textures-upside-down-on-glb-export/24041/6 "2021-09-24T17:31:04Z")

</div>

@nogalo yours is mostly this [PBRMaterial - dynamically update texture with same image, but different outcome - #2 by Deltakosh](https://forum.babylonjs.com/t/pbrmaterial-dynamically-update-texture-with-same-image-but-different-outcome/24059/2) 🙂 funny it happens the same day 🙂
