#version 150 compatibility

uniform int face_illumination;

uniform vec3 face_color;

in vec3 eye_position;
in vec3 normal;

vec4 doLighting(vec3 position, vec3 normal, vec4 diffuseMaterial);

void main()
{
	// compute bump mapped normal
	vec4 diff = vec4(face_color,1.0);
	if (face_illumination == 0) {
		gl_FragColor = diff;
	}
	else {
		gl_FragColor = doLighting(eye_position, normal, diff);
	}
}