From d95a8707cceafe667fc9af77fe753c940949ed13 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Wed, 31 Oct 2018 20:14:30 +0100 Subject: [PATCH] - adjust light radius to match what gzdoom does --- src/lightmap/lightmap.cpp | 2 +- src/lightmap/lightsurface.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lightmap/lightmap.cpp b/src/lightmap/lightmap.cpp index 58d9aa7..81eaf01 100644 --- a/src/lightmap/lightmap.cpp +++ b/src/lightmap/lightmap.cpp @@ -280,7 +280,7 @@ kexVec3 kexLightmapBuilder::LightTexelSample(kexTrace &trace, const kexVec3 &ori continue; } - float radius = tl->radius; + float radius = tl->radius * 2.0f; // 2.0 because gzdoom's dynlights do this and we want them to match float intensity = tl->intensity; if(origin.DistanceSq(lightOrigin) > (radius*radius)) diff --git a/src/lightmap/lightsurface.cpp b/src/lightmap/lightsurface.cpp index 1a07bb1..a2e7046 100644 --- a/src/lightmap/lightsurface.cpp +++ b/src/lightmap/lightsurface.cpp @@ -414,7 +414,7 @@ bool kexLightSurface::TraceSurface(FLevel *doomMap, kexTrace &trace, const surfa float d = origin.Distance(center); - curDist = 1.0f - d / distance; + curDist = 1.0f - d / (distance * 2.0f); // 2.0 because gzdoom's dynlights do this and we want them to match if (curDist < 0.0f) curDist = 0.0f; if(curDist >= 1)