# Different texture format settings for different GLTFs

**URL:** <https://forum.babylonjs.com/t/different-texture-format-settings-for-different-gltfs/3555>\
**Category:** Questions\
**Tags:** material\
**Created:** [May 28, 2019, 1:27pm UTC](https://forum.babylonjs.com/t/different-texture-format-settings-for-different-gltfs/3555 "2019-05-28T13:27:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tortru](https://avatars.discourse-cdn.com/v4/letter/t/3e96dc/32.png) [@tortru](https://forum.babylonjs.com/u/tortru)\
**Post date:** [May 28, 2019, 1:27pm UTC](https://forum.babylonjs.com/t/different-texture-format-settings-for-different-gltfs/3555/1 "2019-05-28T13:27:27Z")

</div>

Hi,

I would like to use KTX textures for some but not all of my models.  
Is it possible to set a different texture format for every GLTF?

The only setting I found is at engine level and since textures are loaded asynchrously,  
I fear that if I switch the format before loading a specific model  
it could effect existing queued textures which have not been loaded yet.

---

<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:** [May 28, 2019, 4:26pm UTC](https://forum.babylonjs.com/t/different-texture-format-settings-for-different-gltfs/3555/2 "2019-05-28T16:26:54Z")

</div>

Do you mean changing the texture file format in the gltf? Or loading different textures afterward?

---

<div class="post-metadata">

**Author:** ![tortru](https://avatars.discourse-cdn.com/v4/letter/t/3e96dc/32.png) [@tortru](https://forum.babylonjs.com/u/tortru)\
**Post date:** [May 29, 2019, 10:08am UTC](https://forum.babylonjs.com/t/different-texture-format-settings-for-different-gltfs/3555/3 "2019-05-29T10:08:19Z")

</div>

I would like to for example first load a GLTF scene with KTX compressed textures,  
then create some Meshes with JPG or PNG Textures from external sources  
and then I would like to dynamically load one or more GLTF objects and for each of them I need to decide whether to use KTX textureFormat or not.

---

<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:** [May 29, 2019, 12:00pm UTC](https://forum.babylonjs.com/t/different-texture-format-settings-for-different-gltfs/3555/4 "2019-05-29T12:00:24Z")

</div>

ping @trevordev

---

<div class="post-metadata">

**Author:** ![trevordev](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/trevordev/32/16_2.png) [@trevordev](https://forum.babylonjs.com/u/trevordev)\
**Post date:** [May 29, 2019, 5:43pm UTC](https://forum.babylonjs.com/t/different-texture-format-settings-for-different-gltfs/3555/5 "2019-05-29T17:43:57Z")

</div>

@tortru I don’t think this is currently supported but the loader is designed to fallback if no ktx file exists so could you enable ktx formats and when loading ktx files it will succeed on the first try but for non ktx gltf’s it will fallback and still succeed or does that not work for you?

---

<div class="post-metadata">

**Author:** ![tortru](https://avatars.discourse-cdn.com/v4/letter/t/3e96dc/32.png) [@tortru](https://forum.babylonjs.com/u/tortru)\
**Post date:** [June 3, 2019, 3:36pm UTC](https://forum.babylonjs.com/t/different-texture-format-settings-for-different-gltfs/3555/6 "2019-06-03T15:36:17Z")

</div>

I hoped I could avoid these unnecessary 404 requests.  
A possible workaround would be to have the models which do not have KTX textures to be loaded as GLBs. In that case no extra requests will be made.

BTW: Is it possible to use KTX textures inside GLB files?

---

<div class="post-metadata">

**Author:** ![trevordev](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/trevordev/32/16_2.png) [@trevordev](https://forum.babylonjs.com/u/trevordev)\
**Post date:** [June 3, 2019, 10:02pm UTC](https://forum.babylonjs.com/t/different-texture-format-settings-for-different-gltfs/3555/7 "2019-06-03T22:02:44Z")

</div>

Yea, avoiding 404s seems like a good idea so I’d like to solve that at some point but I might not get to it for a while (If you have any good suggestions on how to solve this let me know, PRs are welcome). Also GLBs currently don’t support KTX without a custom extension so what you have right now is likely the best you can do in the current state.

---

<div class="post-metadata">

**Author:** ![tortru](https://avatars.discourse-cdn.com/v4/letter/t/3e96dc/32.png) [@tortru](https://forum.babylonjs.com/u/tortru)\
**Post date:** [June 6, 2019, 9:24am UTC](https://forum.babylonjs.com/t/different-texture-format-settings-for-different-gltfs/3555/8 "2019-06-06T09:24:03Z")

</div>

Thank you. I think this workaround should be sufficient for now.

In future I think a good solution would be to support the CTTF extension once it hat been specified.

> **[Google and Binomial Contribute Basis Universal Texture Format to Khronos’...](https://www.khronos.org/blog/google-and-binomial-contribute-basis-universal-texture-format-to-khronos-gltf-3d-transmission-open-standard)**
>
> Earlier today, Google and Binomial announced that they have partnered to open source a sophisticated texture compressor and a high-performance transcoder for Binomial’s cross-platform Basis Universal texture format. This format can help solve a...
