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

Make DDS loading code only check for R channel bitmask when loading grayscale images #80862

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

BlueCube3310
Copy link
Contributor

I've encountered this issue while working on another PR. Here's an MRP: dds_lumi_import.zip

The DDS loading code currently checks for all color channel masks to be set to 0xFF when loading grayscale/luminance images. However, many DDS grayscale images only set the R channel mask, meaning the engine fails to import them. Additionally, the official Microsoft DDS documentation states that only the R bitmask has to be set.

According to the documentation, an additional flag in the file should be specified to discern l8/l8a8 images from r8/r8g8 ones, however, Godot's DDS module currently does not support the latter. If there is demand to implement those formats in the future, we could add a check for that flag.

This PR removes the check for G and B bitmasks, making it possible to import all L8 and L8A8 files correctly. This change shouldn't have any impact on currently imported textures, so it doesn't break compatibility.

@BlueCube3310 BlueCube3310 requested a review from a team as a code owner August 21, 2023 20:50
@Calinou Calinou added this to the 4.2 milestone Aug 21, 2023
@Calinou Calinou added the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Aug 21, 2023
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

The changes make sense, and testing locally I can confirm that it works.

@akien-mga akien-mga merged commit 359bb38 into godotengine:master Aug 28, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Aug 29, 2023
@BlueCube3310 BlueCube3310 deleted the dds-grayscale-load-fix branch April 25, 2024 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants