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

Fix KTX texture format for latest version #2845

Merged
merged 2 commits into from
Jul 22, 2020
Merged

Fix KTX texture format for latest version #2845

merged 2 commits into from
Jul 22, 2020

Conversation

DDoS
Copy link
Contributor

@DDoS DDoS commented Jul 22, 2020

The *_ibl.ktx and *_skybox.ktx files generated by cmgen cannot be read in the latest KTX release (v4.0.0-beta3). This is because glFormat should be unsized, according to spec (so it should be RGB).

@prideout
Copy link
Contributor

Thanks! We should also remove the last case in the switch in toPixelDataFormat in KtxUtility.h.

@prideout prideout self-requested a review July 22, 2020 17:45
Copy link
Contributor

@prideout prideout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Let's also remove the last case in the switch in toPixelDataFormat in KtxUtility.h.

@DDoS DDoS requested a review from prideout July 22, 2020 20:12
@@ -933,7 +933,7 @@ void iblRoughnessPrefilter(
.endianness = KtxBundle::ENDIAN_DEFAULT,
.glType = KtxBundle::R11F_G11F_B10F,
.glTypeSize = 1,
.glFormat = KtxBundle::R11F_G11F_B10F,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed? We need this format for our IBLs. It breaks all environment lighting.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're still using the 11_11_10 (see the glType field), this needed to be unsized to be valid KTX. Is stuff breaking for you?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the issue isn't here. The issue is above.

@@ -933,7 +933,7 @@ void iblRoughnessPrefilter(
.endianness = KtxBundle::ENDIAN_DEFAULT,
.glType = KtxBundle::R11F_G11F_B10F,
.glTypeSize = 1,
.glFormat = KtxBundle::R11F_G11F_B10F,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the issue isn't here. The issue is above.

@@ -227,7 +227,6 @@ namespace ktx {
case KtxBundle::RG: return PixelDataFormat::RG;
case KtxBundle::RGB: return PixelDataFormat::RGB;
case KtxBundle::RGBA: return PixelDataFormat::RGBA;
case KtxBundle::R11F_G11F_B10F: return PixelDataFormat::RGB;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this line breaks compatibility with existing assets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants