1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#endif
uniform sampler2D tex, texuv;
varying vec2 tex_c, tex_cuv;
void main()
{
float y,u,v,vmu,r,g,b;
y=texture2D(tex,tex_c).r;
u=texture2D(texuv,tex_cuv).g;
v=texture2D(texuv,tex_cuv).a;
u=u-0.5;
v=v-0.5;
vmu=v*0.813+u*0.391;
u=u*2.018;
v=v*1.596;
y=(y-0.062)*1.164;
r=y+v;
g=y-vmu;
b=y+u;
gl_FragColor=vec4(r,g,b,1.0);
}
|