# Has KTX2Loader been deprceated?

**URL:** <https://discourse.threejs.org/t/has-ktx2loader-been-deprceated/87937>\
**Category:** Questions\
**Tags:** loader\
**Created:** [November 5, 2025, 7:44pm UTC](https://discourse.threejs.org/t/has-ktx2loader-been-deprceated/87937 "2025-11-05T19:44:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattias\_98](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mattias_98/32/37470_2.png) [@mattias\_98](https://discourse.threejs.org/u/mattias_98)\
**Post date:** [November 5, 2025, 7:44pm UTC](https://discourse.threejs.org/t/has-ktx2loader-been-deprceated/87937/1 "2025-11-05T19:44:36Z")

</div>

I can’t for the life of me get this to work, nor are the very few examples i find online working, which drives me towards the conclusion, has this been depcreated?

```javascript
import * as THREE from "three";
import { renderer, scene, addAnimation } from "./boilerplate";
import { KTX2Loader } from "three/addons/loaders/KTX2Loader.js";

const cube = new THREE.Mesh(
  new THREE.BoxGeometry(1, 1, 1),
  new THREE.MeshBasicMaterial()
);

const loader = new KTX2Loader();
loader.setTranscoderPath("./basis");
loader.detectSupport(renderer);

try {
  const texture = loader.load("./sample_uastc_zstd.ktx2");

  const box2 = new THREE.Mesh(
    new THREE.BoxGeometry(1, 1, 1),
    new THREE.MeshBasicMaterial({ map: texture })
  );
  box2.rotateX(Math.PI / 4);

  box2.material.needsUpdate = true;
  scene.add(box2);
} catch (e) {
  console.error("wowoow", e);
} finally {
  loader.dispose();
}

addAnimation(() => {
  cube.rotation.y += 0.01;
});

```

File format, texture and encoder paths are correct and tested on other resources.

---

<div class="post-metadata">

**Author:** ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)\
**Post date:** [November 5, 2025, 7:58pm UTC](https://discourse.threejs.org/t/has-ktx2loader-been-deprceated/87937/2 "2025-11-05T19:58:47Z")

</div>

KTX2Loader is not deprecated – it’s actively maintained and widely used.

While `loader.load` returns a THREE.Texture instance immediately, the HTTP request is [asynchronous](https://eloquentjavascript.net/11_async.html)_,_ and the texture’s internal data is fetched and processed after _all_ of your code in the try/catch/finally block runs. Because `loader.dispose()` is called synchronously in the finally block, you’ll be disposing the loader before the texture is ready to render, and so probably the loading process never completes.

Instead, you could pass a callback to `.load(url, onSuccess, onProgress, onError)`. Or, perhaps more simply, use loadAsync and await:

```javascript
try {
  const texture = await loader.loadAsync('./sample_uastc_zstd.ktx2');
  ...
} catch (e) {
  ...
} finally {
  loader.dispose();
}

```

Aside – if you’re loading multiple textures I would recommend reusing the loader rather than creating and disposing a loader for each image.

---

<div class="post-metadata">

**Author:** ![mattias\_98](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mattias_98/32/37470_2.png) [@mattias\_98](https://discourse.threejs.org/u/mattias_98)\
**Post date:** [November 5, 2025, 8:17pm UTC](https://discourse.threejs.org/t/has-ktx2loader-been-deprceated/87937/3 "2025-11-05T20:17:58Z")

</div>

Hey, thanks for your response!

I’m aware of asynchronous programming, and I’ve tried this already.

Since THREE.TextureLoader loads textures almost instantly and doesn’t need any await handling, I tried this approach out as well, as the docs doesn’t imply which approach is better. Im aware there is an encoding/decoding process going on here, so there’s more overhead, but still, worth a try.

Is there any sandbox you can refer me to, where this is actually working? I haven’t seen it myself.

thanks!

---

<div class="post-metadata">

**Author:** ![mattias\_98](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mattias_98/32/37470_2.png) [@mattias\_98](https://discourse.threejs.org/u/mattias_98)\
**Post date:** [November 5, 2025, 9:01pm UTC](https://discourse.threejs.org/t/has-ktx2loader-been-deprceated/87937/4 "2025-11-05T21:01:50Z")

</div>

I forgot a / at the end of my transcoderpath, im the idiot here, sorry for the hassle!
