acdream/docs/research/deepdives
Erik a54cd7bef6 fix(lighting): match retail indoor ambient (0.20 neutral, not 0.10/0.09/0.08 warm)
Indoor cells rendered "almost black" because the hardcoded ambient at
GameWindow.cs:8342-8345 was an early-2026 guess (0.10, 0.09, 0.08 — half
retail brightness, warm-tinted) rather than the retail value. The named
retail decomp (acclient.pdb, Sept 2013 EoR build) shows
CellManager::ChangePosition @ 0x004559B0 calls
SmartBox::SetWorldAmbientLight(0.2f, 0xFFFFFFFF) whenever the player's
CObjCell::seen_outside flag is 0 — a flat 0.20 white floor, not a
dungeon-tone warm color.

Investigation also confirmed:
- EnvCell.dat does NOT carry inline lights — CEnvCell::UnPack reads
  numVisibleCells where Binary Ninja's heuristic decomp inferred
  "num_lights". Retail's CObjCell.light_list is populated at runtime via
  add_light() calls from neighbouring cell light registrations + per-cell
  static-object Setup.Lights, NOT from the dat byte stream.
- Setup.Lights from indoor static objects (entity.SourceGfxObjOrSetupId
  prefix 0x02xxxxxx) DO flow through LightInfoLoader.Load (line 5765)
  and reach LightManager via LightingHookSink. The wire is intact; the
  per-frame Tick + UBO upload chain (line 6865-6867) is intact.
- Retail's particle system does NOT emit lights from particles themselves.
  The light comes from the owning Setup's LightInfo records.

Pre-existing failures in DispatcherToMovementIntegrationTests, BSPStepUpTests,
and MotionInterpreterTests are on the branch already and unrelated to this
change (verified by stashing + retesting).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 10:14:25 +02:00
..
00-master-synthesis.md docs+feat: 13 retail-AC deep-dives (R1-R13) + C# port scaffolds + roadmap E-H 2026-04-18 10:32:44 +02:00
r01-spell-system.md docs+feat: 13 retail-AC deep-dives (R1-R13) + C# port scaffolds + roadmap E-H 2026-04-18 10:32:44 +02:00
r02-combat-system.md docs+feat: 13 retail-AC deep-dives (R1-R13) + C# port scaffolds + roadmap E-H 2026-04-18 10:32:44 +02:00
r03-motion-animation.md docs+feat: 13 retail-AC deep-dives (R1-R13) + C# port scaffolds + roadmap E-H 2026-04-18 10:32:44 +02:00
r04-vfx-particles.md docs+feat: 13 retail-AC deep-dives (R1-R13) + C# port scaffolds + roadmap E-H 2026-04-18 10:32:44 +02:00
r05-audio-sound.md docs+feat: 13 retail-AC deep-dives (R1-R13) + C# port scaffolds + roadmap E-H 2026-04-18 10:32:44 +02:00
r06-items-inventory.md docs+feat: 13 retail-AC deep-dives (R1-R13) + C# port scaffolds + roadmap E-H 2026-04-18 10:32:44 +02:00
r07-character-creation.md docs+feat: 13 retail-AC deep-dives (R1-R13) + C# port scaffolds + roadmap E-H 2026-04-18 10:32:44 +02:00
r08-network-protocol-atlas.md docs+feat: 13 retail-AC deep-dives (R1-R13) + C# port scaffolds + roadmap E-H 2026-04-18 10:32:44 +02:00
r09-dungeon-portal-space.md docs+feat: 13 retail-AC deep-dives (R1-R13) + C# port scaffolds + roadmap E-H 2026-04-18 10:32:44 +02:00
r10-quest-dialogs.md docs+feat: 13 retail-AC deep-dives (R1-R13) + C# port scaffolds + roadmap E-H 2026-04-18 10:32:44 +02:00
r11-allegiance.md docs+feat: 13 retail-AC deep-dives (R1-R13) + C# port scaffolds + roadmap E-H 2026-04-18 10:32:44 +02:00
r12-weather-daynight.md docs+feat: 13 retail-AC deep-dives (R1-R13) + C# port scaffolds + roadmap E-H 2026-04-18 10:32:44 +02:00
r13-dynamic-lighting.md fix(lighting): match retail indoor ambient (0.20 neutral, not 0.10/0.09/0.08 warm) 2026-05-19 10:14:25 +02:00