# Load KTX2 de/transcoder from own server

**URL:** <https://forum.babylonjs.com/t/load-ktx2-de-transcoder-from-own-server/30324>\
**Category:** Questions\
**Created:** [May 12, 2022, 2:20pm UTC](https://forum.babylonjs.com/t/load-ktx2-de-transcoder-from-own-server/30324 "2022-05-12T14:20:47Z")\
**Posts on this page:** 5\
**Page:** 1

<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:** [May 12, 2022, 2:20pm UTC](https://forum.babylonjs.com/t/load-ktx2-de-transcoder-from-own-server/30324/1 "2022-05-12T14:20:47Z")

</div>

Hello,

the ktx2 transcoders are getting downloaded from [https://preview.babylonjs.com/](https://preview.babylonjs.com/).

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/d/4d4e56a9bba03c3e361b32d8e983ccdf5bff1894.png)

Is there a way to set it up, that these files are coming from your own server?

---

<div class="post-metadata">

**Author:** ![br-matt](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/br-matt/32/22436_2.png) [@br-matt](https://forum.babylonjs.com/u/br-matt)\
**Post date:** [May 12, 2022, 2:32pm UTC](https://forum.babylonjs.com/t/load-ktx2-de-transcoder-from-own-server/30324/2 "2022-05-12T14:32:25Z")

</div>

You can override that with `KhronosTextureContainer2.JSModuleURL` set to the full url/path to `babylon.ktx2Decoder.js` and it will grab the wasm modules from the same place after that

---

<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:** [May 13, 2022, 6:59am UTC](https://forum.babylonjs.com/t/load-ktx2-de-transcoder-from-own-server/30324/3 "2022-05-13T06:59:08Z")

</div>

Nice, looks exactly like what I need! [KhronosTextureContainer2 | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/babylon.khronostexturecontainer2#urlconfig)

---

<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:** [May 13, 2022, 8:08am UTC](https://forum.babylonjs.com/t/load-ktx2-de-transcoder-from-own-server/30324/4 "2022-05-13T08:08:27Z")

</div>

Ok it works if I use an absolute path from our server `https://website.com/ktx2-decoders/babylon.ktx2Decoder.js`, but I can’t use relative paths. Is this expected?

---

<div class="post-metadata">

**Author:** ![br-matt](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/br-matt/32/22436_2.png) [@br-matt](https://forum.babylonjs.com/u/br-matt)\
**Post date:** [May 13, 2022, 4:29pm UTC](https://forum.babylonjs.com/t/load-ktx2-de-transcoder-from-own-server/30324/5 "2022-05-13T16:29:37Z")

</div>

You seem correct on that part. It took me some digging to figure out why and a SO post led me to:

[https://www.html5rocks.com/en/tutorials/workers/basics/](https://www.html5rocks.com/en/tutorials/workers/basics/)

TLDR:

> Loading External Scripts
> 
> When using these techniques to inline your worker code, `importScripts()` will only work if you supply an absolute URI. If you attempt to pass a relative URI, the browser will complain with a security error. The reason being: the worker (now created from a blob URL) will be resolved with a `blob:` prefix, while your app will be running from a different (presumably `http://` ) scheme. Hence, the failure will be due to cross origin restrictions.
