For an element of my project I’m packing four greyscale images into the layers of a texture–one each in the red, green, blue, and alpha channels.
This works well–save for the fact that, for some reason, the images stored in the alpha channels, as rendered by a shader, are noticeably darker than those in the other three channels.
In my image-editor (GIMP), all four channels appear to be of the same overall brightness.
Is this an expected result? And if so, is there anything that I might do in order to produce even lightness across all channels? (Aside, I suppose, from brightening the alpha channel.)
@serega-kkz is correct, alpha channels are always stored linear and don’t use the sRGB transfer function, so the gamma is different.
There is no way to use the sRGB gamma curve with the alpha channel. The F_rgba mode in Panda uses linear sampling for all channels, whereas F_srgb_alpha uses gamma correction for the RGB channels and linear sampling for the alpha channel.
Ah, fair enough, and thank you for the explanation!
Ah, I see–in that case “F_rgba” might be better still for my purposes.
I am going to want to think about whether and how I’m going to apply this fix, as it may have consequences for other colours in my project if applied universally.
But it does look as though the problem is as you two outlined, and that a solution is available.