Hi there, I'm struggling to understand why we need a gamma-correction. Here is what I understand so far:
- We load a texture from file (e.g with jpeg format), it almost always pre-corrected (??) - color (0.5, 0.5, 0.5) is stored as (0.72, 0.72, 0.72). (power 1/2.2)
- Inside a fragment shader we need to convert our texture fron non-linear space back to linear - (0.72, 0.72, 0.72) is converted back to (0.5, 0.5, 0.5) (power 2.2)
- After all callculations are done, color should be trasformed back to non-linear space - color (0.5, 0.5, 0.5) (or some another final color) is converted back to (0.72, 0.72, 0.72) (power 1/2.2)
But there are two more steps:
- Monitor transforms color (almost) back - color (0.72, 0.72, 0.72) is converted again to (0.5, 0.5, 0.5)
- Our eyes - color (0.5, 0.5, 0.5) is converted AGAIN? to (0.72, 0.72, 0.72)
The question is, why do the formats like JPEG are converting color by raising it to (1 / 2.2), isn't our task is to see (0.5, 0.5, 0.5) (gray) and not (0.72, 0.72, 0.72) (light-gray)?
Another question. If I have a texture and I don't know whether the first step was applied (i.e raising to (1 / 2.2) power) or not, should I apply the conversion to linear space? I'm using DirectX and WICTextureLoader, but it doesn't load my image in *_SRGB format. I have an option to force it to do so, but I'm not sure is that correct.