X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=gamma_expansion_effect.frag;h=b8e3581f53772107880d9b90b68981a95e9f35d9;hp=359b026450c916f52d9f486bac11c2f6dcff3b71;hb=f216b7bef5a968c89f6fc78e83cc26a91e504a8a;hpb=9a00101dbb6f98d21c6b8ce4d33200af840ea908 diff --git a/gamma_expansion_effect.frag b/gamma_expansion_effect.frag index 359b026..b8e3581 100644 --- a/gamma_expansion_effect.frag +++ b/gamma_expansion_effect.frag @@ -1,8 +1,9 @@ // Expand gamma curve. -uniform float PREFIX(linear_scale); -uniform float PREFIX(c0), PREFIX(c1), PREFIX(c2), PREFIX(c3), PREFIX(c4); -uniform float PREFIX(beta); +// Implicit uniforms: +// uniform float PREFIX(linear_scale); +// uniform float PREFIX(c)[5]; +// uniform float PREFIX(beta); vec4 FUNCNAME(vec2 tc) { vec4 x = INPUT(tc); @@ -10,7 +11,7 @@ vec4 FUNCNAME(vec2 tc) { vec3 a = x.rgb * PREFIX(linear_scale); // Fourth-order polynomial approximation to pow(). See the .cpp file for details. - vec3 b = PREFIX(c0) + (PREFIX(c1) + (PREFIX(c2) + (PREFIX(c3) + PREFIX(c4) * x.rgb) * x.rgb) * x.rgb) * x.rgb; + vec3 b = PREFIX(c[0]) + (PREFIX(c[1]) + (PREFIX(c[2]) + (PREFIX(c[3]) + PREFIX(c[4]) * x.rgb) * x.rgb) * x.rgb) * x.rgb; vec3 f = vec3(greaterThan(x.rgb, vec3(PREFIX(beta)))); x = vec4(mix(a, b, f), x.a);