[my blog] [my software] [contacts]

back to today

22 june 2013

Gamma correction in WebGL

I was unsure if WebGL GLSL shaders are supposed to perform gamma correction on the output or if this is already perfomed by the OS/browser.

Fortunately looks like you must simply output colors in linear space, WebGL takes care of the correction.

You can test this yourself by watching this shader on Shadertoy.

I haven't yet tested what happens on the inputs (on the textures you load). There is some information on StackOverflow but not as much as I was hoping.

UPDATE: I was wrong, WebGL does not apply gamma correction on the output, you must perform it in your shaders, see the comments on Shadertoy.
Comments disabled