#version 330 core

layout(location = 0) in vec2 aPosition;
layout(location = 1) in vec2 aUv;
layout(location = 2) in float aAlpha;

out vec2 vUv;
out float vAlpha;

uniform vec2 iResolution;

void main()
{
    vec2 ndc = vec2(
        (aPosition.x / max(iResolution.x, 1.0)) * 2.0 - 1.0,
        1.0 - (aPosition.y / max(iResolution.y, 1.0)) * 2.0
    );

    gl_Position = vec4(ndc, 0.0, 1.0);
    vUv = aUv;
    vAlpha = aAlpha;
}
