3 uniform float PREFIX(linear_scale);
4 uniform float PREFIX(c0), PREFIX(c1), PREFIX(c2), PREFIX(c3), PREFIX(c4);
5 uniform float PREFIX(beta);
7 vec4 FUNCNAME(vec2 tc) {
10 vec3 a = x.rgb * PREFIX(linear_scale);
12 // Fourth-order polynomial approximation to pow(). See the .cpp file for details.
13 vec3 b = PREFIX(c0) + (PREFIX(c1) + (PREFIX(c2) + (PREFIX(c3) + PREFIX(c4) * x.rgb) * x.rgb) * x.rgb) * x.rgb;
15 vec3 f = vec3(greaterThan(x.rgb, vec3(PREFIX(beta))));
16 x = vec4(mix(a, b, f), x.a);