Fixed specularity disabling not being effective

This commit is contained in:
Michaël Lemaire 2016-02-07 23:39:55 +01:00
parent 457f0c6345
commit b3787ed7ea

View file

@ -121,7 +121,8 @@ Color LightingManager::applyFinalComponent(const LightComponent &component, cons
}
/* specular reflection */
if (sign > 0.0 && material.shininess > 0.0 && material.reflection > 0.0 && component.reflection > 0.0) {
if (specularity && sign > 0.0 && material.shininess > 0.0 && material.reflection > 0.0 &&
component.reflection > 0.0) {
Vector3 view = location.sub(eye).normalize();
Vector3 reflect = direction_inv.sub(normal.scale(2.0 * direction_inv.dotProduct(normal)));
double specular = reflect.dotProduct(view);