/*************************************************************
GLSL Demo - Anisotropic lighting fragment shader
(c) 2005 Antoine Bouthors, EVASION
*************************************************************/

varying vec3 normal;
varying vec3 lightDir;

void main()
{
	vec3 Nnormal = normalize( normal );
	vec3 NlightDir = normalize( lightDir );
	vec3 ReflectedRay = reflect( NlightDir, Nnormal );
	
	float intensity = pow( 1. - dot( Nnormal, NlightDir ), 5. );
	intensity *= dot( Nnormal, NlightDir ) * 20.;
	vec3 color = gl_LightSource[0].diffuse.xyz * clamp( intensity, 0., 1. );
	gl_FragColor.xyz = .1 + .9*color;
}
