From 1e70a5a484475f358660f372ef000fd9c83e3e20 Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 13 Jun 2026 20:58:03 +0200 Subject: [PATCH] =?UTF-8?q?fix(G.3=20A7):=20torch=20range=20=3D=20Falloff?= =?UTF-8?q?=20x=201.5=20(retail=20rangeAdjust)=20=E2=80=94=20wider=20pools?= =?UTF-8?q?=20(#133)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Retail PrimD3DRender::config_hardware_light (0x0059ad30) sets the hardware light Range = Falloff * rangeAdjust (1.5, global 0x00820cc4). We used Range = Falloff, so torches reached only 2/3 of retail -> tight 'candle/spotlight' bubbles in dungeons. Match retail's reach. Ambient 0.20 confirmed retail-faithful (the 0.30 was CreatureMode, not world cells). Lighting suite green. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/AcDream.Core/Lighting/LightInfoLoader.cs | 7 ++++++- tests/AcDream.Core.Tests/Lighting/LightingHookSinkTests.cs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/AcDream.Core/Lighting/LightInfoLoader.cs b/src/AcDream.Core/Lighting/LightInfoLoader.cs index 63a250f4..db9bf9bc 100644 --- a/src/AcDream.Core/Lighting/LightInfoLoader.cs +++ b/src/AcDream.Core/Lighting/LightInfoLoader.cs @@ -79,7 +79,12 @@ public static class LightInfoLoader (info.Color?.Green ?? 255) / 255f, (info.Color?.Blue ?? 255) / 255f), Intensity = info.Intensity, - Range = info.Falloff, + // Retail PrimD3DRender::config_hardware_light (0x0059ad30) sets the + // hardware light Range = Falloff * rangeAdjust, where rangeAdjust is + // the fixed global 1.5 (0x00820cc4). Our prior Range = Falloff reached + // only 2/3 of retail's distance → tight torch bubbles (the dungeon + // "candles/spotlights" report, #133 A7). Match retail's reach. + Range = info.Falloff * 1.5f, ConeAngle = info.ConeAngle, OwnerId = ownerId, IsLit = true, diff --git a/tests/AcDream.Core.Tests/Lighting/LightingHookSinkTests.cs b/tests/AcDream.Core.Tests/Lighting/LightingHookSinkTests.cs index c3884a66..0651b274 100644 --- a/tests/AcDream.Core.Tests/Lighting/LightingHookSinkTests.cs +++ b/tests/AcDream.Core.Tests/Lighting/LightingHookSinkTests.cs @@ -93,7 +93,7 @@ public sealed class LightInfoLoaderTests var light = result[0]; Assert.Equal(LightKind.Point, light.Kind); Assert.Equal(77u, light.OwnerId); - Assert.Equal(8f, light.Range); + Assert.Equal(12f, light.Range); // Falloff 8 × retail rangeAdjust 1.5 (config_hardware_light) Assert.Equal(0.8f, light.Intensity); Assert.Equal(new Vector3(101, 202, 303), light.WorldPosition); Assert.InRange(light.ColorLinear.X, 0.99f, 1.01f);