view liboggplayer-src/bin/yuv2rgb.frag @ 62:301805d68a97 default tip

Clean up better.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 06 Jan 2015 04:33:07 +0200
parents 105513a2e3c9
children
line wrap: on
line source

uniform sampler2D y_tex;
uniform sampler2D u_tex;
uniform sampler2D v_tex;

void main (void)
{
	float y = texture2D(y_tex, vec2(gl_TexCoord[0])).r;
	float u = texture2D(u_tex, vec2(gl_TexCoord[0])).r-0.5;
	float v = texture2D(v_tex, vec2(gl_TexCoord[0])).r-0.5;
	float r = y + 1.13983*v;
	float g = y - 0.39465*u-0.58060*v;
	float b = y + 2.03211*u;
	gl_FragColor  = vec4(r,g,b,1);
}