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

Set blue channel as used for compressed normal maps #62646

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions core/io/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3076,6 +3076,11 @@ void Image::adjust_bcs(float p_brightness, float p_contrast, float p_saturation)
Image::UsedChannels Image::detect_used_channels(CompressSource p_source) const {
ERR_FAIL_COND_V(data.size() == 0, USED_CHANNELS_RGBA);
ERR_FAIL_COND_V(is_compressed(), USED_CHANNELS_RGBA);

if (p_source == COMPRESS_SOURCE_NORMAL) {
return USED_CHANNELS_RGB;
}

bool r = false, g = false, b = false, a = false, c = false;

const uint8_t *data_ptr = data.ptr();
Expand Down Expand Up @@ -3124,11 +3129,6 @@ Image::UsedChannels Image::detect_used_channels(CompressSource p_source) const {
used_channels = USED_CHANNELS_RGB;
}

if (p_source == COMPRESS_SOURCE_NORMAL) {
//use RG channels only for normal
used_channels = USED_CHANNELS_RG;
}

return used_channels;
}

Expand Down