# Texture loading incorrectly on glb exported from BabylonJS

**URL:** <https://forum.babylonjs.com/t/texture-loading-incorrectly-on-glb-exported-from-babylonjs/31530>\
**Category:** Questions\
**Tags:** material, exporter, texture\
**Created:** [June 20, 2022, 5:36pm UTC](https://forum.babylonjs.com/t/texture-loading-incorrectly-on-glb-exported-from-babylonjs/31530 "2022-06-20T17:36:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://forum.babylonjs.com/u/DanielS)\
**Post date:** [June 20, 2022, 5:36pm UTC](https://forum.babylonjs.com/t/texture-loading-incorrectly-on-glb-exported-from-babylonjs/31530/1 "2022-06-20T17:36:07Z")

</div>

I have a glb file exported from BabylonJS without any texture applied on it

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

however when I test it on sandbox, and try applying texture on it, the texture is not loaded properly  
(Left is the original glb exported, right is after applying texture)

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

But then, if I export the glb with texture applied from BabylonJS, I can then apply texture on the model, and it is loaded correctly  
(Left is the glb applied with texture exported, right is after applying same texture as above)

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

---

<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:** [June 20, 2022, 5:45pm UTC](https://forum.babylonjs.com/t/texture-loading-incorrectly-on-glb-exported-from-babylonjs/31530/2 "2022-06-20T17:45:20Z")

</div>

cc @bghgary

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [June 20, 2022, 6:28pm UTC](https://forum.babylonjs.com/t/texture-loading-incorrectly-on-glb-exported-from-babylonjs/31530/3 "2022-06-20T18:28:28Z")

</div>

I’m not reproducing this behavior. I see this after exporting it the second time.

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/9/7946b02b7f6d0242f7f4f4cd25f6b7688b3d1c03.png)

The problem is that the UVs are not being exported. By default, the exporter does not export unused UVs (though I noticed we are still exporting the buffers, @Guillaume_Pelletier maybe you can check this?). There is an option to export the unused UVs in the exporter code, but it is not currently available as an option the inspector UI. Maybe we can add one.

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://forum.babylonjs.com/u/DanielS)\
**Post date:** [June 21, 2022, 2:55am UTC](https://forum.babylonjs.com/t/texture-loading-incorrectly-on-glb-exported-from-babylonjs/31530/4 "2022-06-21T02:55:18Z")

</div>

I see, I didn’t realise unused UVs are not exported. So, seems like it should be the problem of missing UV as it is unused and not being exported. I am going to enable it, thanks~!!!

---

<div class="post-metadata">

**Author:** ![mathus1](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mathus1/32/8535_2.png) [@mathus1](https://forum.babylonjs.com/u/mathus1)\
**Post date:** [December 12, 2022, 4:20pm UTC](https://forum.babylonjs.com/t/texture-loading-incorrectly-on-glb-exported-from-babylonjs/31530/5 "2022-12-12T16:20:33Z")

</div>

How to enable exporting unused UV maps? Any solution?

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [December 12, 2022, 5:39pm UTC](https://forum.babylonjs.com/t/texture-loading-incorrectly-on-glb-exported-from-babylonjs/31530/6 "2022-12-12T17:39:08Z")

</div>

I responded in the other thread: [Object UV map not saving after exporting as glb - #4 by bghgary](https://forum.babylonjs.com/t/object-uv-map-not-saving-after-exporting-as-glb/36429/4)
