light: GetDirectLighting: fix wrong order in surfpointToLightDist calculation

This commit is contained in:
Eric Wasylishen 2022-06-02 20:58:03 -06:00
parent 0eeabaeb21
commit 5488f47eda
1 changed files with 1 additions and 1 deletions

View File

@ -1244,7 +1244,7 @@ std::map<int, qvec3f> 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)