add tonemapping shaders

This commit is contained in:
2020-05-22 19:59:34 +08:00
parent eb0b29275e
commit 23685cd868
18 changed files with 606 additions and 59 deletions

11
shader/ToneMap/ACES.glsl Normal file
View File

@@ -0,0 +1,11 @@
// ACES tone map
// see: https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/
vec3 ToneMapping(vec3 color)
{
const float A = 2.51;
const float B = 0.03;
const float C = 2.43;
const float D = 0.59;
const float E = 0.14;
return linearTosRGB(clamp((color * (A * color + B)) / (color * (C * color + D) + E), 0.0, 1.0));
}