#version 430

#include "ssbo_ui.glslshared"

layout(std430, binding=0) buffer Elems
{
	ssbo_ui elems[];
};
uniform float ar;
layout(location=0) in vec2 vtx_Pos;
smooth out vec2 uv;
flat out int inst;

void main(void) {
	inst = gl_InstanceID;
	vec2 foo = (elems[inst].pos + vtx_Pos * elems[inst].size) * vec2(0.01, ar/100);
	foo.y = 1.0 - foo.y;
	foo = foo * 2 - 1.0;
	gl_Position = vec4(foo, 0.0, 1.0);
	uv = vtx_Pos;
}
