Open MarkCallow opened 4 years ago
This file has revealed a bug in ktx2check
so thanks for that but I apologise that it showed this file as valid.
I've fixed the problem in ktx2check
. See issue https://github.com/KhronosGroup/KTX-Software/issues/309 and PR https://github.com/KhronosGroup/KTX-Software/pull/310.
Thx a lot ... we will first fix the bug in slimktx2 here: https://github.com/ux3d/slimktx2/issues/7
Noticing similar issues with the file here: https://github.com/KhronosGroup/glTF-Sample-Environments/blob/master/neutral/lambertian/diffuse.ktx2
The color model is UNSPECIFIED which fails with the latest libktx source, and if that is skipped then ktxTexture_calcImageSize ends up returning 0 due to invalid format data.
Probably worth doing a pass on regenerating the .ktx2 files with the latest standard, especially as libktx 4.0 is around the corner.
I just tried to load this file (or any other file from master branch) and ktx2check gives the following error:
ERROR: DFD totalSize differs from header's dfdByteLength.
ERROR: DFD for a VK_FORMAT_R16G16B16A16_SFLOAT texture must have sample
information.
ERROR: DFD bytesPlane0 must be non-zero for non-supercompressed texture
with VK_FORMAT_R16G16B16A16_SFLOAT.
ERROR: DFD colorModel for non block-compressed textures must be RGBSDA.
ktx2check v4.0
The file is invalid. @UX3D-nopper please regenerate the file(s).
Yeah. I end up running ibl-sampler
script manually on HDR files to create the necessary textures.
https://github.com/KhronosGroup/glTF-Sample-Environments/blob/master/helipad/charlie/sheen.ktx2 has an invalid data format descriptor. Probably any other file written by "UX3D SlimKTX2 v1.0" is also invalid. The problems are:
The libktx reader uses the DFD in order to avoid a big switch on the VkFormat so the invalid DFD causes it to return an error when trying to load this file.. The three.js loader also uses the DFD info and I'm sure other software does too.