diff --git a/light/ltface.cc b/light/ltface.cc index 0dbe4ef0..59179fe8 100644 --- a/light/ltface.cc +++ b/light/ltface.cc @@ -1244,7 +1244,7 @@ std::map GetDirectLighting( qvec3d surfpointToLightDir; // FIXME: this is always 128 because vpl.pos and origin are always equal it seems? const float surfpointToLightDist = - max(128.0, GetDir(vpl.pos, origin, + max(128.0, GetDir(origin, vpl.pos, surfpointToLightDir)); // Clamp away hotspots, also avoid division by 0... const vec_t angle = qv::dot(surfpointToLightDir, normal); if (angle <= 0)