[Public WebGL] WEBGL_compressed_texture_s3tc_srgb

Mark Callow [email protected]
Tue Jun 14 18:47:18 PDT 2016

There is a canvas color space proposal <https://github.com/junov/CanvasColorSpace/blob/master/CanvasColorSpaceProposal.md> under development for both WebGL and 2D canvases. It describes some of the issues with the current situation as well as a solution. The proposal is being discussed here <https://discourse.wicg.io/t/canvas-color-spaces-wide-gamut-and-high-bit-depth-rendering/1505>.

It is imprecise to say that gl_FragColor is in gamma space. BTW, this is the first time I have heard it called gamma space. I like to think of it as compressed or non-linear space. Values written to gl_FragColor, OpenGL ES 2 and WebGL 1, or user-defined color outputs, OpenGL ES 3 and WebGL 2, are in linear space. If the the value of FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING is SRGB then the values will be compressed to non-linear before being written to the framebuffer. Otherwise they are written as is.

WebGL 1 & OpenGl ES 2 do not support sRGB rendering so the values are written as is. The framebuffer is therefore considered to hold linear data and its values should be compressed to non-linear (a.k.a. gamma corrected) by the browser or window/operating system before being sent to the display, assuming a non-linear display. Unfortunately browsers differ in how they handle this and, especially on mobile devices, it is unclear which if any OSes apply gamma correction. Only in cases where no gamma correction is applied can the values written to gl_FragColor be considered to be in non-linear space.

The canvas color space proposal together with sRGB rendering support is intended to resolve these and other color space issues.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20160615/8b0948de/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20160615/8b0948de/attachment.asc>

More information about the public_webgl mailing list