[Bf-committers] OpenGL sRGB

Jason Wilkins jason.a.wilkins at gmail.com
Sun Jul 28 18:44:15 CEST 2013


GL_ARB_framebuffer_sRGB is an extension that tells OpenGL that the values
in the framebuffer are sRGB (i.e., they are being displayed on a computer
monitor) and therefore should be automatically gamma corrected when read
and written, allowing a shader to assume linear values and for framebuffer
blending to work correctly.

I'm all for making sure that values are linear before being loaded as
textures, although if the GL_SRGB format is available, sRGB textures could
be loaded directly without conversion.

The purpose of the sRGB extensions (framebuffer and texture) seems to be to
make the entire pipeline able to assume linear color values and only doing
the correction at the end points.



On Sun, Jul 28, 2013 at 5:53 AM, Antony Riakiotakis <kalast at gmail.com>wrote:

> 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.
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>


More information about the Bf-committers mailing list