#version 450

layout(location=0) in vec3 a_position;
layout(location=1) in vec4 a_color;
layout(location=2) in vec2 a_tx_coords;

layout(binding=0,std140) uniform Ubo {
    mat4 u_model_mat;
    mat4 u_view_mat;
    mat4 u_projection_mat;
} ubo;

layout(location=0) out vec2 o_position;
layout(location=1) out vec4 o_color;
layout(location=2) out vec2 o_tx_coords;

void main()
{
    vec4 position = ubo.u_model_mat * vec4(a_position, 1.0);

    o_position = position.xy;
    o_color = a_color;
    o_tx_coords = vec2(a_tx_coords.x, 1.0 - a_tx_coords.y);

    gl_Position = ubo.u_projection_mat * ubo.u_view_mat * position;
}
