1 // Expand Rec. 601/Rec. 709 gamma curve.
6 uniform sampler1D PREFIX(rec709_tex);
8 vec4 FUNCNAME(vec2 tc) {
9 vec4 x = LAST_INPUT(tc);
11 x.r = texture1D(PREFIX(rec709_tex), x.r).x;
12 x.g = texture1D(PREFIX(rec709_tex), x.g).x;
13 x.b = texture1D(PREFIX(rec709_tex), x.b).x;
20 // use arithmetic (slow)
21 vec4 FUNCNAME(vec2 tc) {
22 vec4 x = LAST_INPUT(tc);
24 vec3 a = x.rgb * vec3(1.0/4.500);
25 vec3 b = pow((x.rgb + vec3(0.099)) * vec3(1.0/1.099), vec3(1.0/0.45));
26 vec3 f = vec3(greaterThan(x.rgb, vec3(0.081)));
28 return vec4(mix(a, b, f), x.a);