evas: fix shader for nv12.

SVN revision: 63835
This commit is contained in:
Cedric BAIL 2011-10-05 10:16:25 +00:00
parent 27431cacdd
commit a33eccf6e2
6 changed files with 78 additions and 3 deletions

View File

@ -143,5 +143,22 @@ shader/filter_sepia_bgra_nomul.shd \
shader/filter_blur.shd \
shader/filter_blur_nomul.shd \
shader/filter_blur_bgra.shd \
shader/filter_blur_bgra_nomul.shd
shader/filter_blur_bgra_nomul.shd \
shader/nv12_frag.h \
shader/nv12_frag.shd \
shader/nv12_nomul_frag.h \
shader/nv12_nomul_frag.shd \
shader/nv12_nomul_vert.h \
shader/nv12_nomul_vert.shd \
shader/nv12_vert.h \
shader/nv12_vert.shd \
shader/yuy2_frag.h \
shader/yuy2_frag.shd \
shader/yuy2_nomul_frag.h \
shader/yuy2_nomul_frag.shd \
shader/yuy2_nomul_vert.h \
shader/yuy2_nomul_vert.shd \
shader/yuy2_vert.h \
shader/yuy2_vert.shd

View File

@ -40,4 +40,8 @@ compile yuv
compile yuv_nomul
compile tex
compile tex_nomul
compile nv12
compile nv12_nomul
compile yuy2
compile yuy2_nomul
## FIXME: compile filter_*

View File

@ -0,0 +1,27 @@
#ifdef GL_ES
precision mediump float;
#endif
uniform sampler2D tex, texuv;
varying vec4 col;
varying vec2 tex_c, tex_cuv;
void main()
{
float y,u,v,vmu,r,g,b;
y=texture2D(tex,tex_c).g;
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) * col;
}

View File

@ -0,0 +1,27 @@
#ifdef GL_ES
precision mediump float;
#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).g;
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);
}

View File

@ -10,5 +10,5 @@ void main()
{
gl_Position = mvp * vertex;
tex_y = tex_coord;
tex_cuv = tex_coord2;
tex_cuv = tex_coord2 * 0.5;
}

View File

@ -12,5 +12,5 @@ void main()
gl_Position = mvp * vertex;
col = color;
tex_y = tex_coord;
tex_cuv = tex_coord2;
tex_cuv = tex_coord2 * 0.5;
}