light: bounce: force a "gate" like cutoff for bounce lights

This commit is contained in:
Eric Wasylishen 2016-04-28 23:18:49 -06:00
parent 430c4b39b7
commit 6459e53316
1 changed files with 19 additions and 15 deletions

View File

@ -1016,7 +1016,7 @@ void GetIndirectLighting (const bsp2_t *bsp, const bsp2_dface_t *face, const vec
if (dp2 < 0) if (dp2 < 0)
continue; // vpl behind sample face continue; // vpl behind sample face
if (TestLight(vpl.pos, origin, NULL)) { // get light contribution
vec3_t color; vec3_t color;
VectorScale(vpl.color, vpl.area, color); VectorScale(vpl.color, vpl.area, color);
@ -1029,12 +1029,16 @@ void GetIndirectLighting (const bsp2_t *bsp, const bsp2_dface_t *face, const vec
const vec_t scale = dp1 /* * dp2 */ * (1.0/dist2) * bouncescale; const vec_t scale = dp1 /* * dp2 */ * (1.0/dist2) * bouncescale;
// dp2 makes things too angle-dependent // dp2 makes things too angle-dependent
// no occlusion VectorScale(color, 255 * scale, color);
VectorMA(colorout, scale, color, colorout);
if (((color[0] + color[1] + color[2]) / 3) < 0.25)
continue; // too dim
if (TestLight(vpl.pos, origin, NULL)) {
VectorAdd(colorout, color, colorout);
} }
} }
VectorScale(colorout, 255, colorout);
return; return;
} }