

//#version 430
varying vec4 Normal;
varying vec4 Position;
uniform float ID;
#define oUV gl_TexCoord[0]
uniform sampler2D MyTexture;
varying vec2 UVs;






vec4 FromYCoCg(vec2 UV)
{
	vec4 col = texture2D(MyTexture, UV);

	float Co = col[0] - 0.5;
	float Cg = col[1] - 0.5;
	float  Y = col[3];

	float G = Y+Cg;
	float B = Y-Co-Cg;
	float R = Y+Co-Cg;

	return vec4(B ,G, R, 1.0);
}



void main () 
{

	gl_FragData[0].xyzw = FromYCoCg(UVs.st);



}
