acdream/tools/cdb/issue176-floor-light.cdb
Erik 8cb3176daa feat(lighting): SelectForCell (all dynamic lights per EnvCell) + #176 handoff — residual is a runtime z-fight
cdb trace of LIVE retail (tools/cdb/issue176-floor-light.cdb, binary<->PDB MATCH) PROVED retail
applies ALL its dynamic lights — 4 intensity-100 magenta portal lights (d3dIdx 3-6, falloff 6) +
the viewer fill (d3dIdx 1, 2.25) — as D3D hardware lights to EVERY Facility Hub cell, every frame,
stable. So the faceted purple wedges on the floor are retail-FAITHFUL. acdream did a per-cell
SelectForObject sphere-overlap 8-cap for cells, so the portal set could differ/flip per cell.

- LightManager.SelectForCell (retail minimize_envcell_lighting 0x0054c170): ALL dynamic lights
  applied unconditionally (shader range cutoff zeroes non-reaching = D3D hardware range), then
  nearest static torches fill remaining slots. Wired into EnvCellRenderer.GetCellLightSet.
  Objects keep SelectForObject (minimize_object_lighting). Pins:
  SelectForCell_AppliesAllDynamicLights_EvenOutOfReach + _SameDynamicSet_ForCellsFarApart_NoFlap.
- Apparatus: [light-detail] gains owner/cell/dyn (pinned the culprit = 2 portal weenies
  0x000F4247/48 in 0x8A020118/19, intensity=100 magenta); CellVertexNormals_SmoothOrFaceted_Dump
  (corridor floor uses SMOOTH per-vertex dat normals, not flat); tools/cdb/issue176-floor-light.cdb.

#176 RESIDUAL is NOT this fix. It's a RUNTIME draw z-fight in the seam floor. Eliminated (evidence):
NOT lighting (per-light cap + this both no-change), NOT membership (render cell 0x8A020164 stable
100% of 188k frames / 526 angles, res=None), NOT dat geometry (coplanar sweep empty at z=-6 floor
incl. cell 0164). NEXT = RenderDoc pixel-history. Full handoff + DO-NOT-RETRY:
docs/research/2026-07-06-176-seam-floor-zfight-handoff.md. Suites green: Core 2599 + 2 skip.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 13:55:16 +02:00

26 lines
1.4 KiB
Text

$$
$$ #176 floor triangles - retail light-setup trace (2026-07-06)
$$ Q: does retail set up the DYNAMIC magenta portal light (intensity=100,
$$ color 0.784,0,0.784) as a HARDWARE light applied to the corridor CELL?
$$ If yes -> retail's cell floor IS lit by the portal via D3D hardware T&L,
$$ so the per-vertex wedge pattern is retail-FAITHFUL, not an acdream bug.
$$
$$ config_hardware_light(d3dIndex@[esp+4], _D3DLIGHT9* out@[esp+8],
$$ ulong cellID@[esp+0xc], LIGHTINFO* info@[esp+0x10])
$$ d3dIdx 1-10 = DYNAMIC (viewer / teleport PORTAL); 11+ = STATIC (wall torch, baked)
$$ Dumping the cellID lets us see WHICH cell the magenta portal is configured for.
$$
.logopen C:\Users\erikn\source\repos\acdream\.claude\worktrees\vigorous-joliot-f0c3ad\retail-floor-light.log
.sympath C:\Users\erikn\source\repos\acdream\refs
.symopt+ 0x40
.reload /f acclient.exe
r $t0 = 0
r $t1 = 0
$$ config_hardware_light - every hardware light setup, with its cell id + LIGHTINFO.
bp acclient!PrimD3DRender::config_hardware_light "r $t0=@$t0+1; r $t1=@$t1+1; .printf /D \"[CHL] hit#%d d3dIdx=%d cell=%08x\\n\", @$t1, dwo(@esp+4), dwo(@esp+0xc); dt acclient!LIGHTINFO dwo(@esp+0x10) type intensity falloff color; .if (@$t0 >= 500) { qd } .else { gc }"
.printf \"issue176-floor-light armed: config_hardware_light with cell id + LIGHTINFO. Stand in the corridor looking at the purple floor+walls. qd (auto-detach) after 500 hits.\\n\"
g