From 5f8388285824b2b80ff9cd7a32bea379e180cf2e Mon Sep 17 00:00:00 2001 From: Brian Lach Date: Tue, 14 Feb 2023 12:58:57 -0500 Subject: [PATCH] palettizer: don't respect srgb flag for alpha textures --- pandatool/src/palettizer/textureProperties.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pandatool/src/palettizer/textureProperties.cxx b/pandatool/src/palettizer/textureProperties.cxx index ced4dad771..bb670539b9 100644 --- a/pandatool/src/palettizer/textureProperties.cxx +++ b/pandatool/src/palettizer/textureProperties.cxx @@ -471,11 +471,16 @@ fully_define() { } // Respect the _srgb flag. If this is set, it means the texture is in sRGB - // space and the format should be changed to reflect that. + // color space and the format should be changed to reflect that. if (_srgb) { switch (_num_channels) { case 1: - _format = EggTexture::F_sluminance; + // Don't respect sRGB for textures using the F_alpha format, which + // indicates that the image represents an alpha channel, not a color + // channel. + if (_format != EggTexture::F_alpha) { + _format = EggTexture::F_sluminance; + } break; case 2: _format = EggTexture::F_sluminance_alpha;