While troubleshooting unfamiliar code, I encountered the following 3 errors related to 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 showing up as black, which I suspect is connected to these warnings.
I've narrowed it down to this portion of the 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)));
});
}
After this, it delves into ThreeJS internal code that I am not skilled enough to handle.
The formats are coming in with a format of 36492
, which I believe is KTX2 based on my research, so I'm unsure of what's triggering the error. Oddly enough, it works on some colleagues' machines but not on mine.
Any insights on what might be causing this issue?