light: hack around invalid normals in bounce lighting patches.. needs further investigation
This commit is contained in:
parent
8284eba493
commit
11304cf059
|
|
@ -1260,7 +1260,12 @@ ProjectPointOntoPlane(const vec3_t point, const plane_t *plane, vec3_t out)
|
||||||
void
|
void
|
||||||
GetDirectLighting(const globalconfig_t &cfg, raystream_t *rs, const vec3_t origin, const vec3_t normal, vec3_t colorout)
|
GetDirectLighting(const globalconfig_t &cfg, raystream_t *rs, const vec3_t origin, const vec3_t normal, vec3_t colorout)
|
||||||
{
|
{
|
||||||
const float occlusion = DirtAtPoint(cfg, rs, origin, normal, /* FIXME: pass selfshadow? */ nullptr);
|
float occlusion = DirtAtPoint(cfg, rs, origin, normal, /* FIXME: pass selfshadow? */ nullptr);
|
||||||
|
if (isnan(occlusion)) {
|
||||||
|
// HACK: getting an invalid normal of (0, 0, 0).
|
||||||
|
occlusion = 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
VectorSet(colorout, 0, 0, 0);
|
VectorSet(colorout, 0, 0, 0);
|
||||||
|
|
||||||
for (const light_t &entity : GetLights()) {
|
for (const light_t &entity : GetLights()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue