Error KTX2Loader: .transcodeImage failed

I’m trying to load a gltf with some ktx2 textures. With some models it works correctly, but with others it throws the following error:

I tried viewer from @donmccurdy and it works as expected. I use the following code to load the gltf:

  const loader = new GLTFLoader();
  const loaderKTX2 = new KTX2Loader();

  const loadedData = await loader.loadAsync(modelUrl);


Any suggestions will be greatly appreciated! :slight_smile:

I haven’t seen this error before and am not quite sure what to make of it. Would you be able to share a demo?

If you’re loading more than one model, it might be worth trying to reuse the same KTX2Loader across all of them.

I was debugging and I saw that the ktx file was incorrectly uploaded to the server. Now it’s working perfectly, thank you!

1 Like