[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] gamma/color profile and sRGB



On Tue, Nov 25, 2014 at 8:58 AM, Florian Bösch <pyalot@gmail.com> 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(
        color*12.92,
        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.