diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-05-11 17:20:10 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-05-11 17:29:35 +0300 |
commit | 3fbafaffa11632e3b9f7011317060777c48040aa (patch) | |
tree | 33137b7b031e91d011ce9e2f28ca7a97edf9ee01 /source/blender/draw/engines/eevee/shaders | |
parent | 3341c11bccf46c82aaf7b45f9249913e91885a52 (diff) |
Eevee: Add tonemapping using ocio.
Actually it's done by the Draw Manager, so other engines can use it.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/tonemap_frag.glsl | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/tonemap_frag.glsl b/source/blender/draw/engines/eevee/shaders/tonemap_frag.glsl deleted file mode 100644 index cb2ceb5ed07..00000000000 --- a/source/blender/draw/engines/eevee/shaders/tonemap_frag.glsl +++ /dev/null @@ -1,28 +0,0 @@ - -uniform sampler2D hdrColorBuf; - -in vec4 uvcoordsvar; - -out vec4 fragColor; - -float linearrgb_to_srgb(float c) -{ - if (c < 0.0031308) - return (c < 0.0) ? 0.0 : c * 12.92; - else - return 1.055 * pow(c, 1.0 / 2.4) - 0.055; -} - -void linearrgb_to_srgb(vec4 col_from, out vec4 col_to) -{ - col_to.r = linearrgb_to_srgb(col_from.r); - col_to.g = linearrgb_to_srgb(col_from.g); - col_to.b = linearrgb_to_srgb(col_from.b); - col_to.a = col_from.a; -} - -void main() { - fragColor = texture(hdrColorBuf, uvcoordsvar.st); - - linearrgb_to_srgb(fragColor, fragColor); -}
\ No newline at end of file |