#version 450
layout(location = 0) in vec3 aPos;
layout(location = 1) in vec3 aColor;

layout(std140, binding = 0) uniform Globals {
    mat4  uMVP;
    float uSize;
};

layout(location = 0) out vec3 vColor;

void main() {
    vColor = aColor;
    vec4 clip = uMVP * vec4(aPos, 1.0);
    gl_Position = clip;
    gl_PointSize = clamp(uSize / max(clip.w, 0.1), 2.0, 24.0);
}
