precision mediump float;

varying vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
uniform sampler2D uvTexture;
const highp mat3 yuv2rgb = mat3(vec3(1.164,  1.164, 1.164),
		vec3(0.0, -0.392, 2.017),
		vec3(1.596, -0.813,   0.0));
void main()
{
	lowp float y = texture2D(inputImageTexture, textureCoordinate).r - 16./255.;
	lowp vec2 ra = texture2D(uvTexture, textureCoordinate).ra - vec2(0.5, 0.5);
	lowp vec3 rgb = yuv2rgb * vec3(y, ra.y, ra.x);
	gl_FragColor = vec4(rgb, 1.);   
}