uniform mat4 mvp;

in vec4 Position;
in vec4 Color;
in vec2 TexCoord;
out vec4 colorV;
out vec4 bgColorV;

out float tcy;
uniform vec4 offsets[16];
uniform vec4 colors[16];
uniform vec4 bgColors[16];

out float minAmt;
out float maxAmt;

void main(void) {
	colorV	 = Color * colors[gl_InstanceID];
	bgColorV = bgColors[gl_InstanceID];

	minAmt = offsets[gl_InstanceID].z;
	maxAmt = offsets[gl_InstanceID].w;

	tcy			= (1.0 - TexCoord.y);
	vec4 off	= vec4(offsets[gl_InstanceID].xy, 0., 0.);
	gl_Position = mvp * (Position + off);
}