#version 330 core

layout(location=0) in vec3 position;
layout(location=1) in vec3 normal;
layout(location=2) in vec2 uv;

out vec2 texCoord;
out vec3 FragPos;
out vec3 Normal;
out vec4 FragPosLightSpace;

uniform mat4 view_proj;
uniform mat4 model;
uniform mat4 lightMVPMatrix;

void main()
{
	gl_Position = view_proj *model* vec4(position, 1.0f);
	FragPos = vec3(model *vec4(position, 1.0f));
	Normal = transpose(inverse(mat3(model)))*normal;
	texCoord = uv;
	FragPosLightSpace = lightMVPMatrix * vec4(FragPos, 1.0f);
}
