[Public WebGL] gamma/color profile and sRGB

Florian Bösch [email protected]
Tue Nov 25 00:38:29 PST 2014

On Tue, Nov 25, 2014 at 8:58 AM, Florian Bösch <[email protected]> wrote:

> Which can fail unless you have support for TEXTURE_SRGB_DECODE so you can
> read out raw values from an sRGB texture for use in a non-linear color
> space compositor.

Well, you could fall back to:

vec3 gammasRGB(vec3 color){
    return mix(
        pow(color, vec3(1.0/2.4))*1.055-0.055,
        step((0.04045/12.92), color)

 But I'm not sure that under certain conditions (high contrast display,
magnification, low fragment shader precision) you won't get noticable
artifacts. Would need careful testing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20141125/543a8025/attachment.html>

More information about the public_webgl mailing list