uniform sampler2D SampleTex;

void main(void)
{
	vec2
	  cPos = gl_TexCoord[0].xy,
	  cClamp = gl_TexCoord[0].zw;
	  
	if (cClamp.y < cPos.y) cPos.y = cClamp.y;
	if (cClamp.x < cPos.x) cPos.x = cClamp.x;

	vec4
	  cRGBA = texture2D(SampleTex, cPos);

	if (gl_TexCoord[0].x < (cClamp.x - 0.000001))
	{	  
	  gl_FragColor = cRGBA;
	}
	else if (gl_TexCoord[0].x > (cClamp.x + 0.000001))
	{
	  gl_FragColor = cRGBA.gggg;
	}
	else
	{
	  gl_FragColor.bgra = cRGBA.bggg;
	}
	
}

