diff --git a/light/light.cc b/light/light.cc index 701d8cbc..9dc0638a 100644 --- a/light/light.cc +++ b/light/light.cc @@ -1016,25 +1016,29 @@ void GetIndirectLighting (const bsp2_t *bsp, const bsp2_dface_t *face, const vec if (dp2 < 0) continue; // vpl behind sample face + // get light contribution + vec3_t color; + VectorScale(vpl.color, vpl.area, color); + + // clamp away hotspots + if (dist < 128) { + dist = 128; + } + + const vec_t dist2 = (dist * dist); + const vec_t scale = dp1 /* * dp2 */ * (1.0/dist2) * bouncescale; + // dp2 makes things too angle-dependent + + VectorScale(color, 255 * scale, color); + + if (((color[0] + color[1] + color[2]) / 3) < 0.25) + continue; // too dim + if (TestLight(vpl.pos, origin, NULL)) { - vec3_t color; - VectorScale(vpl.color, vpl.area, color); - - // clamp away hotspots - if (dist < 128) { - dist = 128; - } - - const vec_t dist2 = (dist * dist); - const vec_t scale = dp1 /* * dp2 */ * (1.0/dist2) * bouncescale; - // dp2 makes things too angle-dependent - - // no occlusion - VectorMA(colorout, scale, color, colorout); + VectorAdd(colorout, color, colorout); } } - VectorScale(colorout, 255, colorout); return; }