Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
ThreeJS KTX2Loader "Attempt to load unsupported compressed texture format in .uploadTexture()"

I'm debugging some unfamiliar code, and am getting the following 3 when it's loading KTX2 textures:

THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()

WebGL warning: compressedTexSubImage: format must match the format of the existing texture image.

WebGL warning: blitFramebuffer: DRAW_FRAMEBUFFER may not have multiple samples.

The textures are also loading in as black, which I believe is linked to the warnings.

I've managed to track it down to these bits of code

this.ktx2Loader = new KTX2Loader(this.manager).detectSupport(editor.renderer.renderer);

...

loader = this.ktx2Loader;
const texture = await loadTexture(textureUrl, loader);

...

function loadTexture(src, textureLoader = new TextureLoader()) {
  return new Promise((resolve, reject) => {
    textureLoader.load(src, resolve, null, error => reject(new RethrownError(`Error loading texture "${src}"`, error)));
  });
}

And that's where it disappears into ThreeJS internal code that I'm not experienced enough to know how to handle.

The formats are loading in with a format of 36492 which I believe is KTX2 from what I can tell, so I'm a little unsure of what's causing the error. Stranger still it's working on some co-workers machines, but not my own.

Anyone know what might be going on?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The compressed format you try to load (36492 or 0x8E8C) is EXT_texture_compression_bptc and more specifically COMPRESSED_RGBA_BPTC_UNORM_EXT (aka BC7) Here is the webgl spec

Any compressed format support in webgl is provided as an extension. As such you cannot assume that any format is supported for a given platform/hardware. Generally, each OS require it's own set.

To properly use compressed texture in webgl, you need to export various formats, and based on runtime capabilities tests, load the proper one. And ultimatly, always provide a non compressed fallback(jpg, png, webp...).

Note that KTX is just a container and not a compression format/codec. It can contain any format AFAIK.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!