#include "light.glsl"

uniform vec3 emission;
uniform vec3 ambient;
uniform vec3 diffuse;
uniform vec3 specular;
uniform float shininess;

varying vec4 color;

void main()
{
	vec4 vertex = gl_ModelViewMatrix*gl_Vertex;

	vec3 eye_space_vertex;
	vec3 eye_space_normal;
	eye_space_vertex = vertex.xyz;
	eye_space_normal = gl_NormalMatrix*gl_Normal;
	
	color = vec4(lighting(emission, ambient, diffuse, specular, shininess, eye_space_vertex, eye_space_normal), 1.0);

	gl_Position = gl_ProjectionMatrix*vertex;
}