From a9ea9891bf69241bd94f17cfd51cdde237a1b265 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Tue, 26 Apr 2016 01:10:15 -0600 Subject: [PATCH] light: calculate normals before correcting points, better results in concave areas --- light/ltface.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/light/ltface.c b/light/ltface.c index 68d2e10e..96da8b54 100644 --- a/light/ltface.c +++ b/light/ltface.c @@ -629,9 +629,7 @@ CalcPoints(const modelinfo_t *modelinfo, const vec3_t offset, lightsurf_t *surf, TexCoordToWorld(us, ut, &surf->texorg, point); VectorAdd(point, offset, point); - // corrects point - CheckObstructed(surf, offset, us, ut, point); - + // do this before correcting the point, so we can wrap around the inside of pipes if (surf->curved) { CalcPointNormal(bsp, face, norm, point, 0); @@ -640,6 +638,9 @@ CalcPoints(const modelinfo_t *modelinfo, const vec3_t offset, lightsurf_t *surf, { VectorCopy(surf->plane.normal, norm); } + + // corrects point + CheckObstructed(surf, offset, us, ut, point); } } }