uniform sampler2D myTexture;

varying vec3 normal,lightDir;

void main()
{
	vec4 color = gl_LightModel.ambient * gl_FrontMaterial.ambient;
	float NdotL = max( dot(normalize(normal), normalize(lightDir)),0.0 );
	if ( NdotL > 0.0 )
		color += ( gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse * NdotL );

    color += gl_FrontMaterial.specular * gl_LightSource[0].specular * pow( NdotL, gl_FrontMaterial.shininess );

    gl_FragColor = texture2D(myTexture, vec2(gl_TexCoord[0]));
	gl_FragColor *= color;
}
