#version 330 core

layout (location = 0) in vec3 v_position;
layout (location = 1) in vec3 v_normal;
layout (location = 2) in vec3 v_color;

out vec4 fragColor;
out vec3 fragPos;
out vec3 fragNormal;

uniform mat4 projview;
uniform mat4 model;

void main(){
//	gl_Position = vec4(v_position, 1) * projview;
	fragPos = vec3(model * vec4(v_position, 1.0));
	gl_Position = projview * vec4(fragPos, 1.0);

	fragNormal = mat3(transpose(inverse(model))) * v_normal;
	fragColor = vec4(v_color, 1);
}
