Add support for Lum-alpha textures to ETC fallback
This commit is contained in:
parent
7a9fc69a16
commit
cd21200944
1 changed files with 9 additions and 4 deletions
|
@ -139,11 +139,16 @@ static void _compress_etc(Image *p_img, float p_lossy_quality, bool force_etc1_f
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (img_format >= Image::FORMAT_RGBA8 && force_etc1_format) {
|
if (force_etc1_format) {
|
||||||
// If VRAM compression is using ETC, but image has alpha, convert to RGBA4444
|
// If VRAM compression is using ETC, but image has alpha, convert to RGBA4444 or LA8
|
||||||
// This saves space while maintaining the alpha channel
|
// This saves space while maintaining the alpha channel
|
||||||
p_img->convert(Image::FORMAT_RGBA4444);
|
if (detected_channels == Image::DETECTED_RGBA) {
|
||||||
return;
|
p_img->convert(Image::FORMAT_RGBA4444);
|
||||||
|
return;
|
||||||
|
} else if (detected_channels == Image::DETECTED_LA) {
|
||||||
|
p_img->convert(Image::FORMAT_LA8);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t imgw = p_img->get_width(), imgh = p_img->get_height();
|
uint32_t imgw = p_img->get_width(), imgh = p_img->get_height();
|
||||||
|
|
Loading…
Reference in a new issue