#version 330

layout( location = 0 ) in vec3 InVertex;
layout( location = 1 ) in vec3 InNormal;

out vec3 vNormal;
out vec3 vEye;

uniform mat4 ViewMatrix;
uniform mat4 ProjectionMatrix;
uniform mat4 ModelMatrix;
uniform mat4 NormalMatrix;

void main()
{
	vEye = vec3( ( ViewMatrix * ModelMatrix ) * vec4( InVertex, 1.0 ) );
	vNormal = normalize( mat3( NormalMatrix ) * InNormal );
	gl_Position = ProjectionMatrix * ViewMatrix * ModelMatrix * vec4( InVertex, 1.0 );
}