4 // uniform float PREFIX(linear_scale);
5 // uniform float PREFIX(c)[5];
6 // uniform float PREFIX(beta);
8 vec4 FUNCNAME(vec2 tc) {
11 vec3 a = x.rgb * PREFIX(linear_scale);
13 // Fourth-order polynomial approximation to pow(). See the .cpp file for details.
14 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;
16 vec3 f = vec3(greaterThan(x.rgb, vec3(PREFIX(beta))));
17 x = vec4(mix(a, b, f), x.a);