/*
	Cut algorithm - XPeng
*/

#version 130


uniform sampler2D 	inText;		// input sampler
out     vec4 		outText;	// output sampler

uniform float offsetX, offsetY; // cut start point
uniform float scaleW, scaleH;	// cut size scale
uniform float rangeX, rangeY, rangeW, rangeH;

void main()
{
	 vec2 v_texCoord = vec2(gl_TexCoord[0].s*rangeW+rangeX, gl_TexCoord[0].t*rangeH+rangeY);
    if(v_texCoord.x < offsetX || v_texCoord.x > (offsetX+scaleW) || v_texCoord.y < offsetY || v_texCoord.y > (offsetY+scaleH))
        outText = vec4(0,0,0,0);
    else
	    outText = texture2D(inText, gl_TexCoord[0].st);
}
