Fixed specularity disabling not being effective
This commit is contained in:
parent
457f0c6345
commit
b3787ed7ea
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue