#version 130

in vec3 vaatV;
in vec2 vaatT1;

uniform mat4 ModelMatrix;
uniform mat4 ProjMatrix;

uniform vec4 TO; //Texture Offset
uniform vec4 QS; //Quad Pos & Size (X,Y,Width,Height)

out vec2 TC1;

void main()
{
TC1         = vaatT1;
TC1.x       = TO.x+TC1.x*TO.z;
TC1.y       = TO.y+TC1.y*TO.w;

gl_Position = ProjMatrix*ModelMatrix*vec4(QS.x+vaatV.x*QS.z,QS.y+vaatV.y*QS.w,vaatV.z,1.0);
}