#version 440

// Positions/Coordinates
layout (location = 0) in vec3 vertex_position;
// Colors
layout (location = 1) in vec3 vertex_color;
// Texture Coordinates
layout (location = 2) in vec2 vertex_texcoord;
// Normals (not necessarily normalized)
layout (location = 3) in vec3 vertex_normal;

// Outputs the current position for the Fragment Shader
out vec3 vs_position;
// Outputs the color for the Fragment Shader
out vec3 vs_color;
// Outputs the texture coordinates to the Fragment Shader
out vec2 vs_texcoord;
// Outputs the normal for the Fragment Shader
out vec3 vs_normal;

// Imports the transformation matrices
uniform mat4 ModelMatrix;
// Imports the camera matrix
uniform mat4 ViewMatrix;
uniform mat4 ProjectionMatrix;



void main()
{
	vs_position = vec4(ModelMatrix * vec4(vertex_position, 1.f)).xyz;
	vs_color = vertex_color;
	vs_texcoord = vec2(vertex_texcoord.x, vertex_texcoord.y);
	vs_normal = mat3(ModelMatrix) * vertex_normal;

	gl_Position = ProjectionMatrix * ViewMatrix * ModelMatrix * vec4(vertex_position, 1.f);
}

