1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#endif
uniform sampler2D tex, texu, texv;
varying vec2 tex_c, tex_c2, tex_c3;
void main()
{
float r, g, b, y, u, v;
y = texture2D(tex, tex_c.xy).r;
u = texture2D(texu, tex_c2.xy).r;
v = texture2D(texv, tex_c3.xy).r;
y = (y - 0.0625) * 1.164;
u = u - 0.5;
v = v - 0.5;
r = y + (1.402 * v);
g = y - (0.34414 * u) - (0.71414 * v);
b = y + (1.772 * u);
gl_FragColor = vec4(r, g, b, 1.0);
}
|