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 layered HDR texture import with lossless compression #97830

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

BlueCube3310
Copy link
Contributor

Fixes #97827

The layered texture importer was missing some code from the 2D importer.

@BlueCube3310 BlueCube3310 requested a review from a team as a code owner October 4, 2024 21:44
@Calinou Calinou added bug topic:import cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Oct 4, 2024
@Calinou Calinou added this to the 4.4 milestone Oct 4, 2024
@@ -380,7 +380,7 @@ void ResourceImporterTexture::_save_ctex(const Ref<Image> &p_image, const String
f->store_32(0);
f->store_32(0);

if ((p_compress_mode == COMPRESS_LOSSLESS || p_compress_mode == COMPRESS_LOSSY) && p_image->get_format() > Image::FORMAT_RGBA8) {
if ((p_compress_mode == COMPRESS_LOSSLESS || p_compress_mode == COMPRESS_LOSSY) && p_image->get_format() >= Image::FORMAT_RF) {
Copy link
Member

Choose a reason for hiding this comment

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

Note for the future, this changes the behaviour for FORMAT_RGBA4444 and FORMAT_RGB565.

I think the change makes sense as people who intentionally use such compressed formats would be surprised that Godot converts them to an RGBA8 internally. Making note of it here though as it is a change in behaviour.

@Repiteo Repiteo merged commit 5c7059e into godotengine:master Oct 14, 2024
19 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 14, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release topic:import
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RGBH .exr imported as Texture3D with Lossless compression gets converted to RGB8
5 participants