Skip to content

Fix invalid ktx2 files/update them for KTX v4.3.2#11

Open
JMLX42 wants to merge 1 commit intoKhronosGroup:mainfrom
lx-industries:fix/invalid-ktx2
Open

Fix invalid ktx2 files/update them for KTX v4.3.2#11
JMLX42 wants to merge 1 commit intoKhronosGroup:mainfrom
lx-industries:fix/invalid-ktx2

Conversation

@JMLX42
Copy link

@JMLX42 JMLX42 commented Jan 17, 2025

Hello,

I have re-generated all the .ktx2 files because they would not pass ktx2check.
All files should not be valid according to KTX Tools v4.3.2.

I also added prefilter.sh, which is the Bash equivalent of prefilter.bat.

Let me know if something else needs to be done for this to be merged!

@javagl
Copy link

javagl commented Jan 18, 2025

*looks left*
*looks right*
*looks confused* 🙂
Does anybody feel responsible for reviewing and merging this?

I'm not sure what the source of truth is here. There is ktx2check and ktx validate. I assume that they should be ... somehow equivalent...? But ktx validate seems to print more information. I think it's the more recent way of validating stuff.

So... I created some BAT file

echo off
for /R %%f in (*.ktx2) do (
  echo Validating %%f...
  ktx validate %%f
  echo Validating %%f DONE
)

and ran it on main. There, basically every file contains errors.

On this branch, there are still some errors:

C:\glTF-Sample-Environments>echo off 
Validating C:\glTF-Sample-Environments\chromatic\charlie\sheen.ktx2...
Validating C:\glTF-Sample-Environments\chromatic\charlie\sheen.ktx2 DONE
Validating C:\glTF-Sample-Environments\chromatic\ggx\specular.ktx2...
Validating C:\glTF-Sample-Environments\chromatic\ggx\specular.ktx2 DONE
Validating C:\glTF-Sample-Environments\chromatic\lambertian\diffuse.ktx2...
Validating C:\glTF-Sample-Environments\chromatic\lambertian\diffuse.ktx2 DONE
Validating C:\glTF-Sample-Environments\directional\charlie\sheen.ktx2...
Validating C:\glTF-Sample-Environments\directional\charlie\sheen.ktx2 DONE
Validating C:\glTF-Sample-Environments\directional\ggx\specular.ktx2...
Validating C:\glTF-Sample-Environments\directional\ggx\specular.ktx2 DONE
Validating C:\glTF-Sample-Environments\directional\lambertian\diffuse.ktx2...
Validating C:\glTF-Sample-Environments\directional\lambertian\diffuse.ktx2 DONE
Validating C:\glTF-Sample-Environments\doge2\charlie\sheen.ktx2...
Validating C:\glTF-Sample-Environments\doge2\charlie\sheen.ktx2 DONE
Validating C:\glTF-Sample-Environments\doge2\ggx\specular.ktx2...
Validating C:\glTF-Sample-Environments\doge2\ggx\specular.ktx2 DONE
Validating C:\glTF-Sample-Environments\doge2\lambertian\diffuse.ktx2...
Validating C:\glTF-Sample-Environments\doge2\lambertian\diffuse.ktx2 DONE
Validating C:\glTF-Sample-Environments\ennis\charlie\charlie.ktx2...
Validation failed

error-3020: Missing Data Format Descriptor.
    Data Format Descriptor is mandatory but dfdByteOffset is 0 and dfdByteLength is 0.
error-3021: Invalid dfdByteOffset.
    dfdByteOffset is 0 but the Data Format Descriptor must immediately follow (with 4 byte alignment) the Level Index so it must be 344.
Validating C:\glTF-Sample-Environments\ennis\charlie\charlie.ktx2 DONE
Validating C:\glTF-Sample-Environments\ennis\charlie\sheen.ktx2...
Validating C:\glTF-Sample-Environments\ennis\charlie\sheen.ktx2 DONE
Validating C:\glTF-Sample-Environments\ennis\ggx\specular.ktx2...
Validating C:\glTF-Sample-Environments\ennis\ggx\specular.ktx2 DONE
Validating C:\glTF-Sample-Environments\ennis\lambertian\diffuse.ktx2...
Validating C:\glTF-Sample-Environments\ennis\lambertian\diffuse.ktx2 DONE
Validating C:\glTF-Sample-Environments\ennis\lambertian\outputCubeMap.ktx2...
Validation failed

error-3020: Missing Data Format Descriptor.
    Data Format Descriptor is mandatory but dfdByteOffset is 0 and dfdByteLength is 0.
error-3021: Invalid dfdByteOffset.
    dfdByteOffset is 0 but the Data Format Descriptor must immediately follow (with 4 byte alignment) the Level Index so it must be 344.
Validating C:\glTF-Sample-Environments\ennis\lambertian\outputCubeMap.ktx2 DONE
Validating C:\glTF-Sample-Environments\field\charlie\sheen.ktx2...
Validating C:\glTF-Sample-Environments\field\charlie\sheen.ktx2 DONE
Validating C:\glTF-Sample-Environments\field\ggx\specular.ktx2...
Validating C:\glTF-Sample-Environments\field\ggx\specular.ktx2 DONE
Validating C:\glTF-Sample-Environments\field\lambertian\diffuse.ktx2...
Validating C:\glTF-Sample-Environments\field\lambertian\diffuse.ktx2 DONE
Validating C:\glTF-Sample-Environments\footprint_court\charlie\sheen.ktx2...
Validation failed

error-6001: Mismatching dfdTotalSize and dfdByteLength. dfdTotalSize must match dfdByteLength.
    dfdTotalSize is 28 but dfdByteLength is 0 and they must match.
error-6015: Invalid colorModel in basic DFD block for RGB VkFormat.
    DFD block #1 colorModel in basic DFD block is KHR_DF_MODEL_UNSPECIFIED but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be KHR_DF_MODEL_RGBSDA.
error-6025: Invalid sample count in basic DFD block. The sample count must match the expected sample count of the VkFormat.
    DFD block #1 sample count in basic DFD block is 0 but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be 4.
error-6021: Invalid bytesPlanes in basic DFD block. The values do not match the expected values.
    DFD block #1 bytesPlanes in basic DFD block are 0 0 0 0 0 0 0 0 but for VK_FORMAT_R16G16B16A16_SFLOAT textures these must be 8 0 0 0 0 0 0 0.
Validating C:\glTF-Sample-Environments\footprint_court\charlie\sheen.ktx2 DONE
Validating C:\glTF-Sample-Environments\footprint_court\ggx\specular.ktx2...
Validation failed

error-6001: Mismatching dfdTotalSize and dfdByteLength. dfdTotalSize must match dfdByteLength.
    dfdTotalSize is 28 but dfdByteLength is 0 and they must match.
error-6015: Invalid colorModel in basic DFD block for RGB VkFormat.
    DFD block #1 colorModel in basic DFD block is KHR_DF_MODEL_UNSPECIFIED but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be KHR_DF_MODEL_RGBSDA.
error-6025: Invalid sample count in basic DFD block. The sample count must match the expected sample count of the VkFormat.
    DFD block #1 sample count in basic DFD block is 0 but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be 4.
error-6021: Invalid bytesPlanes in basic DFD block. The values do not match the expected values.
    DFD block #1 bytesPlanes in basic DFD block are 0 0 0 0 0 0 0 0 but for VK_FORMAT_R16G16B16A16_SFLOAT textures these must be 8 0 0 0 0 0 0 0.
Validating C:\glTF-Sample-Environments\footprint_court\ggx\specular.ktx2 DONE
Validating C:\glTF-Sample-Environments\footprint_court\lambertian\diffuse.ktx2...
Validating C:\glTF-Sample-Environments\footprint_court\lambertian\diffuse.ktx2 DONE
Validating C:\glTF-Sample-Environments\helipad\charlie\sheen.ktx2...
Validation failed

error-6001: Mismatching dfdTotalSize and dfdByteLength. dfdTotalSize must match dfdByteLength.
    dfdTotalSize is 28 but dfdByteLength is 0 and they must match.
error-6015: Invalid colorModel in basic DFD block for RGB VkFormat.
    DFD block #1 colorModel in basic DFD block is KHR_DF_MODEL_UNSPECIFIED but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be KHR_DF_MODEL_RGBSDA.
error-6025: Invalid sample count in basic DFD block. The sample count must match the expected sample count of the VkFormat.
    DFD block #1 sample count in basic DFD block is 0 but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be 4.
error-6021: Invalid bytesPlanes in basic DFD block. The values do not match the expected values.
    DFD block #1 bytesPlanes in basic DFD block are 0 0 0 0 0 0 0 0 but for VK_FORMAT_R16G16B16A16_SFLOAT textures these must be 8 0 0 0 0 0 0 0.
Validating C:\glTF-Sample-Environments\helipad\charlie\sheen.ktx2 DONE
Validating C:\glTF-Sample-Environments\helipad\ggx\specular.ktx2...
Validation failed

error-6001: Mismatching dfdTotalSize and dfdByteLength. dfdTotalSize must match dfdByteLength.
    dfdTotalSize is 28 but dfdByteLength is 0 and they must match.
error-6015: Invalid colorModel in basic DFD block for RGB VkFormat.
    DFD block #1 colorModel in basic DFD block is KHR_DF_MODEL_UNSPECIFIED but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be KHR_DF_MODEL_RGBSDA.
error-6025: Invalid sample count in basic DFD block. The sample count must match the expected sample count of the VkFormat.
    DFD block #1 sample count in basic DFD block is 0 but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be 4.
error-6021: Invalid bytesPlanes in basic DFD block. The values do not match the expected values.
    DFD block #1 bytesPlanes in basic DFD block are 0 0 0 0 0 0 0 0 but for VK_FORMAT_R16G16B16A16_SFLOAT textures these must be 8 0 0 0 0 0 0 0.
Validating C:\glTF-Sample-Environments\helipad\ggx\specular.ktx2 DONE
Validating C:\glTF-Sample-Environments\helipad\lambertian\diffuse.ktx2...
Validating C:\glTF-Sample-Environments\helipad\lambertian\diffuse.ktx2 DONE
Validating C:\glTF-Sample-Environments\neutral\charlie\sheen.ktx2...
Validating C:\glTF-Sample-Environments\neutral\charlie\sheen.ktx2 DONE
Validating C:\glTF-Sample-Environments\neutral\ggx\specular.ktx2...
Validating C:\glTF-Sample-Environments\neutral\ggx\specular.ktx2 DONE
Validating C:\glTF-Sample-Environments\neutral\lambertian\diffuse.ktx2...
Validating C:\glTF-Sample-Environments\neutral\lambertian\diffuse.ktx2 DONE
Validating C:\glTF-Sample-Environments\papermill\charlie\sheen.ktx2...
Validation failed

error-6001: Mismatching dfdTotalSize and dfdByteLength. dfdTotalSize must match dfdByteLength.
    dfdTotalSize is 28 but dfdByteLength is 0 and they must match.
error-6015: Invalid colorModel in basic DFD block for RGB VkFormat.
    DFD block #1 colorModel in basic DFD block is KHR_DF_MODEL_UNSPECIFIED but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be KHR_DF_MODEL_RGBSDA.
error-6025: Invalid sample count in basic DFD block. The sample count must match the expected sample count of the VkFormat.
    DFD block #1 sample count in basic DFD block is 0 but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be 4.
error-6021: Invalid bytesPlanes in basic DFD block. The values do not match the expected values.
    DFD block #1 bytesPlanes in basic DFD block are 0 0 0 0 0 0 0 0 but for VK_FORMAT_R16G16B16A16_SFLOAT textures these must be 8 0 0 0 0 0 0 0.
Validating C:\glTF-Sample-Environments\papermill\charlie\sheen.ktx2 DONE
Validating C:\glTF-Sample-Environments\papermill\ggx\specular.ktx2...
Validation failed

error-6001: Mismatching dfdTotalSize and dfdByteLength. dfdTotalSize must match dfdByteLength.
    dfdTotalSize is 28 but dfdByteLength is 0 and they must match.
error-6015: Invalid colorModel in basic DFD block for RGB VkFormat.
    DFD block #1 colorModel in basic DFD block is KHR_DF_MODEL_UNSPECIFIED but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be KHR_DF_MODEL_RGBSDA.
error-6025: Invalid sample count in basic DFD block. The sample count must match the expected sample count of the VkFormat.
    DFD block #1 sample count in basic DFD block is 0 but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be 4.
error-6021: Invalid bytesPlanes in basic DFD block. The values do not match the expected values.
    DFD block #1 bytesPlanes in basic DFD block are 0 0 0 0 0 0 0 0 but for VK_FORMAT_R16G16B16A16_SFLOAT textures these must be 8 0 0 0 0 0 0 0.
Validating C:\glTF-Sample-Environments\papermill\ggx\specular.ktx2 DONE
Validating C:\glTF-Sample-Environments\papermill\lambertian\diffuse.ktx2...
Validating C:\glTF-Sample-Environments\papermill\lambertian\diffuse.ktx2 DONE
Validating C:\glTF-Sample-Environments\pisa\charlie\sheen.ktx2...
Validating C:\glTF-Sample-Environments\pisa\charlie\sheen.ktx2 DONE
Validating C:\glTF-Sample-Environments\pisa\ggx\specular.ktx2...
Validating C:\glTF-Sample-Environments\pisa\ggx\specular.ktx2 DONE
Validating C:\glTF-Sample-Environments\pisa\lambertian\diffuse.ktx2...
Validating C:\glTF-Sample-Environments\pisa\lambertian\diffuse.ktx2 DONE

Not sure what to do with that, though...

@MarkCallow
Copy link

I'm not sure what the source of truth is here. There is ktx2check and ktx validate. I assume that they should be ... somehow equivalent...? But ktx validate seems to print more information. I think it's the more recent way of validating stuff.

You have it right @javagl. ktx validate is more recent, more thorough and replaces ktx2check which will be removed in a future release. All files here must pass ktx validate as these are being presented as official samples to the wide world.

@javagl
Copy link

javagl commented Jan 19, 2025

All files here must pass ktx validate

That's what surprised me first: According to the description, the files in this PR have been "freshly" created, and still, many of them fail validation.

But....

(a bit of a rant): This repo is lacking documenation. I read the (comment-free) prefilter.bat, and wondered what cli.exe should be. It took a moment of searching and guessing until I figured out that this happens to be the executable that is created from the glTF-IBL-Sampler (well, call it gltfIblSampler.exe then...).

More importantly: The glTF-IBL-Sampler repo currently uses KTX-Software as a git submodule, with the state https://github.com/KhronosGroup/KTX-Software/tree/d1a25c8a20607a432b2d910a7a761d663c907e8e , which appears to be horribly out-dated.

So (correct me if I'm wrong, but) I think the proper way of updating the sample environments would be:

  • Update the git submodule for KTX-Software in glTF-IBL-Sampler to the latest state (preferably a tagged, versioned one)
  • Compile the whole thing (and call that executable gltfIblSampler.exe....)
  • Run the prefilter.bat (and add comments and a documentation about that in the README.md...)
  • Validate the resulting KTX2 files with ktx validate
    • They should pass validation. Otherwise, something somewhere went very wrong...
  • Check them in here (i.e. either update this PR acordingly, or (maybe better) create a new PR with the valid files)

@JMLX42
Copy link
Author

JMLX42 commented Jan 20, 2025

I have some internal documentation in how to build the CLI, but IMO it does not belong to this repository.

On this branch, there are still some errors:

That is surprising.

IDK if the CLI is using the KTX tools from my system or builds against some vendored lib/source.

I'll have a look and open an issue upstream if relevant.

@JMLX42
Copy link
Author

JMLX42 commented Jan 20, 2025

IDK if the CLI is using the KTX tools from my system or builds against some vendored lib/source.

It uses a git-submodules for KTX-Software targeting the 4.0.0 tag. I'll update it to 4.3.2, rebuild, re-process the HDRs and check again.

If everything checks out, I'll open a PR on glTF-IBL-Sampler.

@JMLX42
Copy link
Author

JMLX42 commented Jan 20, 2025

Even after updating glTF-IBL-Sampler to KTX-Software 4.3.2, some validation fails:

Validating ./neutral/ggx/specular.ktx2
Validating ./neutral/charlie/sheen.ktx2
Validating ./neutral/lambertian/diffuse.ktx2
Validating ./doge2/ggx/specular.ktx2
Validating ./doge2/charlie/sheen.ktx2
Validating ./doge2/lambertian/diffuse.ktx2
Validating ./helipad/ggx/specular.ktx2
Validation failed

error-6001: Mismatching dfdTotalSize and dfdByteLength. dfdTotalSize must match dfdByteLength.
    dfdTotalSize is 28 but dfdByteLength is 0 and they must match.
error-6015: Invalid colorModel in basic DFD block for RGB VkFormat.
    DFD block #1 colorModel in basic DFD block is KHR_DF_MODEL_UNSPECIFIED but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be KHR_DF_MODEL_RGBSDA.
error-6025: Invalid sample count in basic DFD block. The sample count must match the expected sample count of the VkFormat.
    DFD block #1 sample count in basic DFD block is 0 but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be 4.
error-6021: Invalid bytesPlanes in basic DFD block. The values do not match the expected values.
    DFD block #1 bytesPlanes in basic DFD block are 0 0 0 0 0 0 0 0 but for VK_FORMAT_R16G16B16A16_SFLOAT textures these must be 8 0 0 0 0 0 0 0.
Validating ./helipad/charlie/sheen.ktx2
Validation failed

error-6001: Mismatching dfdTotalSize and dfdByteLength. dfdTotalSize must match dfdByteLength.
    dfdTotalSize is 28 but dfdByteLength is 0 and they must match.
error-6015: Invalid colorModel in basic DFD block for RGB VkFormat.
    DFD block #1 colorModel in basic DFD block is KHR_DF_MODEL_UNSPECIFIED but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be KHR_DF_MODEL_RGBSDA.
error-6025: Invalid sample count in basic DFD block. The sample count must match the expected sample count of the VkFormat.
    DFD block #1 sample count in basic DFD block is 0 but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be 4.
error-6021: Invalid bytesPlanes in basic DFD block. The values do not match the expected values.
    DFD block #1 bytesPlanes in basic DFD block are 0 0 0 0 0 0 0 0 but for VK_FORMAT_R16G16B16A16_SFLOAT textures these must be 8 0 0 0 0 0 0 0.
Validating ./helipad/lambertian/diffuse.ktx2
Validating ./directional/ggx/specular.ktx2
Validating ./directional/charlie/sheen.ktx2
Validating ./directional/lambertian/diffuse.ktx2
Validating ./field/ggx/specular.ktx2
Validating ./field/charlie/sheen.ktx2
Validating ./field/lambertian/diffuse.ktx2
Validating ./pisa/ggx/specular.ktx2
Validating ./pisa/charlie/sheen.ktx2
Validating ./pisa/lambertian/diffuse.ktx2
Validating ./chromatic/ggx/specular.ktx2
Validating ./chromatic/charlie/sheen.ktx2
Validating ./chromatic/lambertian/diffuse.ktx2
Validating ./ennis/ggx/specular.ktx2
Validating ./ennis/charlie/sheen.ktx2
Validating ./ennis/charlie/charlie.ktx2
Validation failed

error-3020: Missing Data Format Descriptor.
    Data Format Descriptor is mandatory but dfdByteOffset is 0 and dfdByteLength is 0.
error-3021: Invalid dfdByteOffset.
    dfdByteOffset is 0 but the Data Format Descriptor must immediately follow (with 4 byte alignment) the Level Index so it must be 344.
Validating ./ennis/lambertian/outputCubeMap.ktx2
Validation failed

error-3020: Missing Data Format Descriptor.
    Data Format Descriptor is mandatory but dfdByteOffset is 0 and dfdByteLength is 0.
error-3021: Invalid dfdByteOffset.
    dfdByteOffset is 0 but the Data Format Descriptor must immediately follow (with 4 byte alignment) the Level Index so it must be 344.
Validating ./ennis/lambertian/diffuse.ktx2
Validating ./footprint_court/ggx/specular.ktx2
Validation failed

error-6001: Mismatching dfdTotalSize and dfdByteLength. dfdTotalSize must match dfdByteLength.
    dfdTotalSize is 28 but dfdByteLength is 0 and they must match.
error-6015: Invalid colorModel in basic DFD block for RGB VkFormat.
    DFD block #1 colorModel in basic DFD block is KHR_DF_MODEL_UNSPECIFIED but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be KHR_DF_MODEL_RGBSDA.
error-6025: Invalid sample count in basic DFD block. The sample count must match the expected sample count of the VkFormat.
    DFD block #1 sample count in basic DFD block is 0 but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be 4.
error-6021: Invalid bytesPlanes in basic DFD block. The values do not match the expected values.
    DFD block #1 bytesPlanes in basic DFD block are 0 0 0 0 0 0 0 0 but for VK_FORMAT_R16G16B16A16_SFLOAT textures these must be 8 0 0 0 0 0 0 0.
Validating ./footprint_court/charlie/sheen.ktx2
Validation failed

error-6001: Mismatching dfdTotalSize and dfdByteLength. dfdTotalSize must match dfdByteLength.
    dfdTotalSize is 28 but dfdByteLength is 0 and they must match.
error-6015: Invalid colorModel in basic DFD block for RGB VkFormat.
    DFD block #1 colorModel in basic DFD block is KHR_DF_MODEL_UNSPECIFIED but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be KHR_DF_MODEL_RGBSDA.
error-6025: Invalid sample count in basic DFD block. The sample count must match the expected sample count of the VkFormat.
    DFD block #1 sample count in basic DFD block is 0 but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be 4.
error-6021: Invalid bytesPlanes in basic DFD block. The values do not match the expected values.
    DFD block #1 bytesPlanes in basic DFD block are 0 0 0 0 0 0 0 0 but for VK_FORMAT_R16G16B16A16_SFLOAT textures these must be 8 0 0 0 0 0 0 0.
Validating ./footprint_court/lambertian/diffuse.ktx2
Validating ./papermill/ggx/specular.ktx2
Validation failed

error-6001: Mismatching dfdTotalSize and dfdByteLength. dfdTotalSize must match dfdByteLength.
    dfdTotalSize is 28 but dfdByteLength is 0 and they must match.
error-6015: Invalid colorModel in basic DFD block for RGB VkFormat.
    DFD block #1 colorModel in basic DFD block is KHR_DF_MODEL_UNSPECIFIED but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be KHR_DF_MODEL_RGBSDA.
error-6025: Invalid sample count in basic DFD block. The sample count must match the expected sample count of the VkFormat.
    DFD block #1 sample count in basic DFD block is 0 but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be 4.
error-6021: Invalid bytesPlanes in basic DFD block. The values do not match the expected values.
    DFD block #1 bytesPlanes in basic DFD block are 0 0 0 0 0 0 0 0 but for VK_FORMAT_R16G16B16A16_SFLOAT textures these must be 8 0 0 0 0 0 0 0.
Validating ./papermill/charlie/sheen.ktx2
Validation failed

error-6001: Mismatching dfdTotalSize and dfdByteLength. dfdTotalSize must match dfdByteLength.
    dfdTotalSize is 28 but dfdByteLength is 0 and they must match.
error-6015: Invalid colorModel in basic DFD block for RGB VkFormat.
    DFD block #1 colorModel in basic DFD block is KHR_DF_MODEL_UNSPECIFIED but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be KHR_DF_MODEL_RGBSDA.
error-6025: Invalid sample count in basic DFD block. The sample count must match the expected sample count of the VkFormat.
    DFD block #1 sample count in basic DFD block is 0 but for VkFormat VK_FORMAT_R16G16B16A16_SFLOAT it must be 4.
error-6021: Invalid bytesPlanes in basic DFD block. The values do not match the expected values.
    DFD block #1 bytesPlanes in basic DFD block are 0 0 0 0 0 0 0 0 but for VK_FORMAT_R16G16B16A16_SFLOAT textures these must be 8 0 0 0 0 0 0 0.
Validating ./papermill/lambertian/diffuse.ktx2

TBF, the .ktx2 files are unchanged after re-running prefilter.sh. So it's not surprising.

IMO it's a bug in how glTF-IBL-Sampler uses the ktx libs.

@JMLX42
Copy link
Author

JMLX42 commented Jan 20, 2025

@Devlin1991
Copy link

I ran into this issue, it took some manual breakpoint debugging inside libktx to figure out it was malformed ktx2 files. I ended up regenerating the radiance and SH radiance using cmgen from Filament to work around it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants