Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ktx2ktx2 not working with IBL cubemap? #278

Closed
YVin3D opened this issue Jul 22, 2020 · 5 comments
Closed

ktx2ktx2 not working with IBL cubemap? #278

YVin3D opened this issue Jul 22, 2020 · 5 comments

Comments

@YVin3D
Copy link

YVin3D commented Jul 22, 2020

We're trying to integrate KTX2 into Cesium, but while converting one of our sandcastle cubemaps (attached) to KTX2, I run into this error message:

ktx2ktx2 failed to create ktxTexture; File data is inconsistent with KTX spec.

I'm fairly certain that the texture is valid since it was generated by one of our devs using Google Filament a while back. You can see the file in action on this Cesium example page

Running macOS Catalina 10.15.5, libktx-4.0.0 (latest build at the time of posting this)

kiara_6_afternoon_2k_ibl.ktx2.zip

@DDoS
Copy link
Contributor

DDoS commented Jul 22, 2020

I'm having the same issue, so I did some debugging. The failure happens in ktxCheckHeader1_ because pHeader->glFormat == pHeader->glInternalformat.

Note the comment:

// glInternalFormat is either unsized (which is no longer and should
// never have been supported by libktx) or glFormat is sized.

Filament implements its own KTX writer and uses KtxBundle::R11F_G11F_B10F for both glFormat and glInternalFormat in iblRoughnessPrefilter and extractCubemapFaces, so the error is expected for IBL and skybox KTX files.

It seems Filament is the one that should be fixed.

@MarkCallow
Copy link
Collaborator

Thanks @DDoS. You've saved me some time. Your analysis is correct. Will one of you open an issue for Filament?

@DDoS
Copy link
Contributor

DDoS commented Jul 22, 2020

I'm testing a fix for Filament, I'll open a PR if it works, or an issue if I can't find a fix.

@DDoS
Copy link
Contributor

DDoS commented Jul 22, 2020

@YoussefV The KTX writing issue was fixed in Filament main: google/filament#2845

@YVin3D
Copy link
Author

YVin3D commented Jul 22, 2020

@DDoS Great! Thanks for the help Aleksi!

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

No branches or pull requests

3 participants