light: bounce: force a "gate" like cutoff for bounce lights
This commit is contained in:
parent
430c4b39b7
commit
6459e53316
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue