[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] gamma/color profile and sRGB
Browsers do not composit and operate in linear space. Evidence: http://www.4p8.com/eric.brasseur/gamma.html
. Neither photoshop nor GIMP pass this test either.
The problem with attempting to support sRGB as a drawing buffer in WebGL arises from the sRGB texturing specification, which states that if you read a value (as in texture2D) out from an sRGB texture, it is converted to linear space.
texture2D is what the browsers accelerated compositor would use to read out a texel from an sRGB texture. The texture would have been attached to a framebuffer object, which is what stands in for a canvases drawing buffer.
Today the browser defines that as RGBA, and so no problem arises in pass trough because the bytes just get pasted in. But once you'd have an sRGB texture on the drawing buffer, things get tricky for the pass-trough case, because then the compositor would have to run in linear space, which it doesn't do, it'd output the linear component read from the sRGB texture flat to screen, which is not what was intended. If, on the other hand, the browser itself switches to an sRGB drawing buffer (natively this time), it means everything is now operating in linear space, and quite a lot of the web would start looking subtly (or dramatically) different.