[Bf-committers] OpenGL sRGB

Antony Riakiotakis kalast at gmail.com
Sun Jul 28 12:53:51 CEST 2013

There is always some confusion over this. The idea is that gamma correction
should be done on the final result only. That means that ideally we should
linearize all textures prior to sending them to GPU and only gamma correct
at the end of the pipeline. For instance a diffuse texture should be
linearized before interacting with light in the shaders. The reason this is
not always done is limited precision, especially for byte images.

There are exceptions. Data textures are not linearized before passing to
the GPU but might be required to be gamma corrected for display (Bump maps,
for instance). It's a nice mess really. Troy Sobotka and Morten Mikkelsen
could give you lots of hints here.

There are some disadvantages here, mainly that we will be confined to sRGB
if we use OpenGL sRGB. But we really only need different spaces for render
results and image displays so this might be a non issue.

More information about the Bf-committers mailing list