X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=gamma_expansion_effect.frag;fp=gamma_expansion_effect.frag;h=b8e3581f53772107880d9b90b68981a95e9f35d9;hp=051d2faf1042cc47e0be4b3b715dba67c0333794;hb=b652c5e3e4b1824cbe0e43673346c516b2edab18;hpb=fc1e9e9f7f047e348a34fd691ceda0cd383e9d4f diff --git a/gamma_expansion_effect.frag b/gamma_expansion_effect.frag index 051d2fa..b8e3581 100644 --- a/gamma_expansion_effect.frag +++ b/gamma_expansion_effect.frag @@ -2,7 +2,7 @@ // Implicit uniforms: // uniform float PREFIX(linear_scale); -// uniform float PREFIX(c0), PREFIX(c1), PREFIX(c2), PREFIX(c3), PREFIX(c4); +// uniform float PREFIX(c)[5]; // uniform float PREFIX(beta); vec4 FUNCNAME(vec2 tc) { @@ -11,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);