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

KTX: Add support for loading most ETC-compressed formats #100524

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

BlueCube3310
Copy link
Contributor

@BlueCube3310 BlueCube3310 commented Dec 17, 2024

Follow-up to #100365

Adds support for loading KTX files compressed into ETC, ETC2_RGB, ETC2_RGBA8, ETC2_R11 and ETC2_RG11 formats. This now works since the engine has a dedicated decompression utility for them.

Some sample files for testing: ktx.zip

@fire
Copy link
Member

fire commented Dec 18, 2024

I'm not sure how to review this, but I would like to.

@BlueCube3310
Copy link
Contributor Author

I'm not sure how to review this, but I would like to.

This can be tested simply by importing the attached images into the editor. On mobile hardware the images will be created directly from the data and passed to the GPU. On desktop the process will be the same except they will be decompressed when RenderingDevice/OpenGL try to create them on the GPU.

For comparison purposes the .ktx files can be decompressed with command line tools such as https://github.com/google/etc2comp

Comment on lines +217 to +220
/*case GL_COMPRESSED_SIGNED_R11_EAC:
format = Image::FORMAT_ETC2_R11S;
break;
break;*/
Copy link
Member

Choose a reason for hiding this comment

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

I'd add a comment to describe why this is commented out (most likely because etcpak doesn't support it?).

Same for other commented out blocks below.

@BlueCube3310 BlueCube3310 force-pushed the ktx-etc branch 2 times, most recently from 6bef1fe to 6f02846 Compare January 6, 2025 21:25
@BlueCube3310 BlueCube3310 force-pushed the ktx-etc branch 3 times, most recently from 864727c to 5dbd279 Compare January 14, 2025 12:13
@BlueCube3310 BlueCube3310 requested a review from a team as a code owner January 14, 2025 12:13
@BlueCube3310
Copy link
Contributor Author

The gui-nodes review request isn't required btw, I accidentally rebased this on top of something else

@akien-mga akien-mga requested review from a team and removed request for a team January 14, 2025 15:40
@akien-mga akien-mga modified the milestones: 4.x, 4.4 Jan 14, 2025
@akien-mga akien-mga merged commit e67e8b8 into godotengine:master Jan 14, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

4 participants