-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Closed
Description
Description
The attached file does not load with three.js KTX2Loader at the moment, probably because of an incorrect check in the loader.
The attached file does not have mipmaps – it was generated using:
toktx --t2 --assign_oetf srgb --automipmap --encode etc1s testimage4k.ktx2 inputimage.jpg
--automipmap according to the docs "causes the KTX file to be marked to request generation of a mipmap pyramid when the file is loaded", so should load the file and then request mipmaps to be generated on the GPU side automatically (without adding them in the file).
Reproduction steps
- Load this image with
KTX2Loader: testimage4k.ktx2.zip - Note file does not load with
Error: THREE.KTX2Loader: Invalid texture
Screenshots
Seems the check here is wrong, it should probably check levelCount for undefined or null or "not a number" and not !levelCount?

Version
r177