Skip to content

Commit

Permalink
Light: Include falloff distance when culling dynamic lights
Browse files Browse the repository at this point in the history
Fixes: issue #1213
  • Loading branch information
dscharrer committed Jun 26, 2018
1 parent 79fb4c4 commit a7db068
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/scene/Light.cpp
Expand Up @@ -289,12 +289,7 @@ void PrecalcDynamicLighting(long x0, long z0, long x1, long z1, const Vec3f & ca
EERIE_LIGHT * el = &g_dynamicLights[i];

if(el->exist && el->rgb.r >= 0.f) {
if( el->pos.x >= fx0
&& el->pos.x <= fx1
&& el->pos.z >= fz0
&& el->pos.z <= fz1
&& closerThan(el->pos, camPos, camDepth)
) {
if(closerThan(el->pos, camPos, camDepth + el->fallend)) {
el->treat = 1;
RecalcLight(el);
g_culledDynamicLights[g_culledDynamicLightsCount] = el;
Expand Down

0 comments on commit a7db068

Please sign in to comment.