# How to make ktx2Decoder on local, request it takes too long

**URL:** <https://forum.babylonjs.com/t/how-to-make-ktx2decoder-on-local-request-it-takes-too-long/34760>\
**Category:** Questions\
**Created:** [October 13, 2022, 7:16am UTC](https://forum.babylonjs.com/t/how-to-make-ktx2decoder-on-local-request-it-takes-too-long/34760 "2022-10-13T07:16:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zz\_dz](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zz_dz/32/24906_2.png) [@zz\_dz](https://forum.babylonjs.com/u/zz_dz)\
**Post date:** [October 13, 2022, 7:16am UTC](https://forum.babylonjs.com/t/how-to-make-ktx2decoder-on-local-request-it-takes-too-long/34760/1 "2022-10-13T07:16:26Z")

</div>

![1665645066173](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/9/3/93c289205830fddfa077d06adaeb806bc59d4f06.png)

I changed the model with gltfpack, but I found that the request for these files took a long time. These files were all on [https://preview.babylonjs.com](https://preview.babylonjs.com). My babylon.js is located in the place. Although it is large, but it takes a short time.

Is there any way to use the local babylon.ktx2decoder.js and MSC\_BASIS\_TRANSCODER.JS when loading the model?

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [October 13, 2022, 11:30am UTC](https://forum.babylonjs.com/t/how-to-make-ktx2decoder-on-local-request-it-takes-too-long/34760/2 "2022-10-13T11:30:35Z")

</div>

How did you set up your local project? npm?

---

<div class="post-metadata">

**Author:** ![Regit](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@Regit](https://forum.babylonjs.com/u/Regit)\
**Post date:** [October 13, 2022, 11:42am UTC](https://forum.babylonjs.com/t/how-to-make-ktx2decoder-on-local-request-it-takes-too-long/34760/3 "2022-10-13T11:42:12Z")

</div>

You can change the `KhronosTextureContainer2.URLConfig` [KhronosTextureContainer2 | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/BABYLON.KhronosTextureContainer2#URLConfig)  
i.e. `KhronosTextureContainer2.URLConfig.jsDecoderModule = "https://somewebsite.com/babylon.ktx2Decoder.js"`.

However I wasn’t able to get the files relatively from the local project, it has to be an absolute path. As described in this [Thread](https://forum.babylonjs.com/t/load-ktx2-de-transcoder-from-own-server/30324/4). I now set the paths by getting `document.location.origin` and adding to that.

---

<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:** [October 14, 2022, 12:04am UTC](https://forum.babylonjs.com/t/how-to-make-ktx2decoder-on-local-request-it-takes-too-long/34760/4 "2022-10-14T00:04:48Z")

</div>

Using relative urls should be possible. The code just doesn’t call `Tools.GetAbsoluteUrl` before storing the url. We do this for the Draco module, for example. Feel free to file a GitHub issue for this.

---

<div class="post-metadata">

**Author:** ![zz\_dz](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zz_dz/32/24906_2.png) [@zz\_dz](https://forum.babylonjs.com/u/zz_dz)\
**Post date:** [October 14, 2022, 2:17am UTC](https://forum.babylonjs.com/t/how-to-make-ktx2decoder-on-local-request-it-takes-too-long/34760/5 "2022-10-14T02:17:57Z")

</div>

thanks for help
