From 1b962831a025497dadf75e067e358c28c8ad2fff Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Mon, 9 Dec 2024 15:23:47 +0000 Subject: [PATCH] Normalise sunlight direction --- KeepersCompound.Lightmapper/LightMapper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/KeepersCompound.Lightmapper/LightMapper.cs b/KeepersCompound.Lightmapper/LightMapper.cs index d131945..75973d7 100644 --- a/KeepersCompound.Lightmapper/LightMapper.cs +++ b/KeepersCompound.Lightmapper/LightMapper.cs @@ -72,7 +72,7 @@ public class LightMapper { Enabled = rendParams.useSunlight, QuadLit = rendParams.sunlightMode is RendParams.SunlightMode.QuadUnshadowed or RendParams.SunlightMode.QuadObjcastShadows, - Direction = rendParams.sunlightDirection, + Direction = Vector3.Normalize(rendParams.sunlightDirection), Color = Utils.HsbToRgb(rendParams.sunlightHue, rendParams.sunlightSaturation, rendParams.sunlightBrightness), }; @@ -439,7 +439,7 @@ public class LightMapper ? tracePoints : GetTracePoints(pos, quadOffsets, renderPoly.Center, planeMapper, v2ds); - // TODO: This isn't quite right yet. It seems to be too bright + // This is almost perfect now. Any issues seem to be related to Dark not carrying HSB strength correctly if (settings.Sunlight.Enabled) { // Check if plane normal is facing towards the light // If it's not then we're never going to be (directly) lit by this