fix(G.3 A7): torch range = Falloff x 1.5 (retail rangeAdjust) — wider pools (#133)

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) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-13 20:58:03 +02:00
parent 9e809bc661
commit 1e70a5a484
2 changed files with 7 additions and 2 deletions

View file

@ -79,7 +79,12 @@ public static class LightInfoLoader
(info.Color?.Green ?? 255) / 255f, (info.Color?.Green ?? 255) / 255f,
(info.Color?.Blue ?? 255) / 255f), (info.Color?.Blue ?? 255) / 255f),
Intensity = info.Intensity, 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, ConeAngle = info.ConeAngle,
OwnerId = ownerId, OwnerId = ownerId,
IsLit = true, IsLit = true,

View file

@ -93,7 +93,7 @@ public sealed class LightInfoLoaderTests
var light = result[0]; var light = result[0];
Assert.Equal(LightKind.Point, light.Kind); Assert.Equal(LightKind.Point, light.Kind);
Assert.Equal(77u, light.OwnerId); 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(0.8f, light.Intensity);
Assert.Equal(new Vector3(101, 202, 303), light.WorldPosition); Assert.Equal(new Vector3(101, 202, 303), light.WorldPosition);
Assert.InRange(light.ColorLinear.X, 0.99f, 1.01f); Assert.InRange(light.ColorLinear.X, 0.99f, 1.01f);