#version 450 core

layout(location=0) in vec3 aPos;
layout(location=1) in vec3 aNormal;
layout(location=2) in vec2 aUv;

uniform mat4 uMvp;
uniform mat4 uModel;

out vec2 vUv;
out vec3 vNormal;

void main()
{
    vUv = aUv;

    mat3 normalMat = mat3(transpose(inverse(uModel)));
    vNormal = normalize(normalMat * aNormal);

    gl_Position = uMvp * vec4(aPos, 1.0);
}