diff --git a/include/light/entities.h b/include/light/entities.h index 8558a4e9..74a63516 100644 --- a/include/light/entities.h +++ b/include/light/entities.h @@ -72,6 +72,7 @@ typedef struct entity_s { float atten; float anglescale; int style; + qboolean bleed; /* worldspawn only */ vec_t dirtdepth; diff --git a/light/entities.c b/light/entities.c index beeddf15..b750495c 100644 --- a/light/entities.c +++ b/light/entities.c @@ -1032,6 +1032,9 @@ LoadEntities(const bsp2_t *bsp) { projfov = atof(com_token); } + else if (!strcmp(key, "_bleed")) { + entity->bleed = atoi(com_token); + } else if (!strcmp(key, "_sunlight_penumbra")) { sun_deviance = atof(com_token); } diff --git a/light/ltface.c b/light/ltface.c index 28be7f5b..56454197 100644 --- a/light/ltface.c +++ b/light/ltface.c @@ -1244,7 +1244,7 @@ LightFace_Entity(const bsp2_t *bsp, planedist = DotProduct(entity->origin, plane->normal) - plane->dist; /* don't bother with lights behind the surface */ - if (planedist < 0) + if (planedist < 0 && !entity->bleed) return; /* sphere cull surface and light */ @@ -1270,6 +1270,11 @@ LightFace_Entity(const bsp2_t *bsp, continue; angle = DotProduct(surfpointToLightDir, surfnorm); + if (entity->bleed) { + if (angle < 0) { + angle = -angle; // ericw -- support "_bleed" option + } + } angle = qmax(0.0f, angle); // light can be behind sample point if the light is right on the face /* Check spotlight cone */