#version 330 core

uniform mat4 WorldView;
uniform mat4 WorldProj;
uniform mat4 ModelTr;
uniform mat4 NormalTr; 

layout(location = 0) in vec4 vertex;
layout(location = 1) in vec3 vertexNormal;
layout(location = 2) in vec2 vertexTexture;

out vec3 normalVec;
out vec2 texCoord;
out vec4 worldPos;

void main()
{
    vec4 world = ModelTr * vertex;
    worldPos  = world;
    gl_Position = WorldProj * WorldView * world;

    normalVec = mat3(NormalTr) * vertexNormal;
    texCoord  = vertexTexture;
}