From f773d2a7834e18a215b4ed47e9c337f1e440aed0 Mon Sep 17 00:00:00 2001 From: myT Date: Wed, 26 Feb 2020 23:01:28 +0100 Subject: [PATCH] fixed dynamic light face culling using the untransformed (world-space) light position --- changelog.txt | 2 ++ code/renderer/tr_world.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 653598e..a7a50c9 100644 --- a/changelog.txt +++ b/changelog.txt @@ -137,6 +137,8 @@ chg: r_fullbright is now latched again chg: negative r_swapInterval values will request adaptive V-Sync when using an OpenGL back-end +fix: dynamic lights could incorrectly stop applying to moving entities (e.g. cpm25 elevator) + fix: crash due to lack of memory for the sound system fix: incorrect shader state when loading a map with no lighting diff --git a/code/renderer/tr_world.cpp b/code/renderer/tr_world.cpp index af61843..3fb15c5 100644 --- a/code/renderer/tr_world.cpp +++ b/code/renderer/tr_world.cpp @@ -156,7 +156,7 @@ static qbool R_LightCullBounds( const dlight_t* dl, const vec3_t mins, const vec static qbool R_LightCullFace( const srfSurfaceFace_t* face, const dlight_t* dl ) { - float d = DotProduct( dl->origin, face->plane.normal ) - face->plane.dist; + const float d = DotProduct( dl->transformed, face->plane.normal ) - face->plane.dist; if ( (d < -dl->radius) || (d > dl->radius) ) return qtrue;