v4k-git-backup/demos/html5/art/fx/fxTonemapACES.fs

18 lines
464 B
GLSL

// https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/
vec3 acesFilm(const vec3 x) {
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 clamp((x * (a * x + b)) / (x * (c * x + d ) + e), 0.0, 1.0);
}
out vec4 color;
void main(void) {
vec2 uv = TEXCOORD.st;
vec4 src = texture2D(iChannel0, uv);
color = vec4( acesFilm(src.xyz), src.a);
}