While working on a debug shader for a bevy project I lost precious hours debugging strange behaviour from a fragment shader.
What would you expect the color of the resulting fragments be?
Wrong! It’s not #304C7A
.
For some reason, I might have never noticed this in any of my shader work. Or it’s new in bevy. Or it is setting you can configure in the WGPU output texture.
But the colors returned from a fragment shader should be in Linear RGB, not sRGB. I used this function to get the correct color: