12 lines
368 B
Plaintext
12 lines
368 B
Plaintext
|
// 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));
|
||
|
}
|