view data/shaders/yuv2rgb.fs @ 54:7fd43d272c93 good64bit

Ahh .. yup.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 06 Aug 2013 15:57:30 +0300
parents 785057719d9b
children
line wrap: on
line source

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

uniform float width;
uniform float height;

void main (void)
{
	vec2 p = vec2(((gl_FragCoord.x+(width*0.11))/(width*1.21)), 1.0-(gl_FragCoord.y/height));
	float y = texture2D(y_tex, p).r;
	float u = texture2D(u_tex, p).r-0.5;
	float v = texture2D(v_tex, p).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.0);
}