24 lines
481 B
Plaintext
24 lines
481 B
Plaintext
|
|
||
|
void aces_approx(inout vec3 col)
|
||
|
{
|
||
|
col *= 0.4f;
|
||
|
float a = 2.51f;
|
||
|
float b = 0.03f;
|
||
|
float c = 2.43f;
|
||
|
float d = 0.59f;
|
||
|
float e = 0.14f;
|
||
|
col = clamp((col * (a * col + b)) / (col * (c * col + d) + e), 0.0, 1.0);
|
||
|
}
|
||
|
|
||
|
void mainImage( out vec4 fragColor, in vec2 fragCoord )
|
||
|
{
|
||
|
init_random_state(fragCoord.xy, iTime);
|
||
|
|
||
|
vec2 uv = fragCoord/iResolution.xy;
|
||
|
vec3 col = texture(iChannel0, uv).rgb;
|
||
|
|
||
|
aces_approx(col);
|
||
|
|
||
|
fragColor = vec4(col, 1);
|
||
|
}
|