vec3 color = light_color*surface_diffuse*diffuse_intensity;
if(use_specular)
{
- /* The light vector points towards the light, so reflected will point
- towards the surface - but so does the look vector. */
- vec3 reflected = reflect(light, normal);
- float specular_intensity = pow(max(dot(reflected, look), 0.0), shininess);
+ vec3 reflected = reflect(look, normal);
+ float specular_intensity = pow(max(dot(reflected, light), 0.0), shininess);
color += light_color*surface_specular*specular_intensity;
}
return color;