acdream/tests/AcDream.Core.Tests
Erik 4345e77d62 fix(render): A7 Fix B — per-OBJECT point-light selection (minimize_object_lighting)
Outdoor objects brightened as the camera approached: lighting selected the
nearest 8 lights to the VIEWER and fed that one global set to everything
(LightManager.Tick), so a building's wall torches only lit it once the camera
got close enough for them to win the global top-8. Probe confirmed the scale of
the problem: a single Holtburg view registers 129 point lights — the global cap
of 8 was hopeless.

Retail selects up to 8 lights PER OBJECT by the object's own position
(minimize_object_lighting 0x0054d480), so a torch always lights the wall it
sits on, camera-independent. Ported faithfully:

- LightManager.SelectForObject (pure, TDD, 8 new tests): candidacy
  (light.pos − center)² < (Range + radius)², nearest-8 among those. Plus
  BuildPointLightSnapshot for the per-frame stable-indexed light list.
- mesh_modern.vert: two SSBOs — binding=4 GLOBAL point-light array (the
  snapshot), binding=5 per-instance light SET (8 int indices into it, -1 =
  unused), parallel to the binding=0 instance buffer (mirrors the U.3 clip-slot
  mechanism). accumulateLights keeps ambient + sun from the SceneLighting UBO
  (cleared as faithful by the lighting audit) and loops THIS instance's point
  lights. pointContribution factored out (same calc_point_light wrap+norm shape).
- WbDrawDispatcher: per-entity light set computed ONCE at the isNewEntity site
  (constant across the entity's parts), by the entity's AABB sphere; threaded
  into grp.LightSets parallel to grp.Matrices; global + per-instance buffers
  uploaded in Phase 5. Camera-independent ⇒ stable for static buildings.
- GameWindow: BuildPointLightSnapshot + dispatcher.SetSceneLights each frame.

Tests: 17/17 LightManager + 36/36 dispatcher clip-slot/clip-frame green
(parallel-array lockstep preserved). Visually gated: the meeting hall now holds
steady as the camera approaches (was the popping symptom).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 22:47:40 +02:00
..
Allegiance feat(allegiance): Phase H.2 AllegianceRequests + AllegianceTree model 2026-04-18 17:17:45 +02:00
Audio feat(audio): Phase E.2 OpenAL engine + SoundTable cookbook + hook wiring 2026-04-18 16:38:26 +02:00
Chat fix(chat): /help client-side handler + System dedup + ThatIsNotAValidCommand template 2026-04-25 21:22:07 +02:00
Combat feat(combat): Phase L.1c wire live attack input 2026-04-28 11:58:57 +02:00
Conformance handoff: M1.5 dungeon support (G.3) grounded — design research + the terrain-less-premise refutation 2026-06-13 14:53:27 +02:00
Fixtures diag(render): flap re-diagnosed as portal-flood re-clip DRIFT; physics + camera REFUTED 2026-06-08 11:21:46 +02:00
Input fix(phys): #106 gate-2 — bogus-indoor-claim recovery + spawn-ground entry hold 2026-06-09 23:47:11 +02:00
Items feat(items): Phase F.2 ItemRepository + AppraiseRequest round-trip 2026-04-18 16:55:36 +02:00
Lighting fix(render): A7 Fix B — per-OBJECT point-light selection (minimize_object_lighting) 2026-06-15 22:47:40 +02:00
Meshing fix(render): hide editor-only placement markers in dungeons — port retail's degrade-to-nothing (#136) 2026-06-14 19:03:08 +02:00
Physics fix(G.3a): validated-claim placement keeps the claim's landblock prefix (#133) 2026-06-13 18:27:45 +02:00
Player feat(player): #5 PlayerDescription parser — Stam/Mana via attribute block 2026-04-25 16:42:24 +02:00
Plugins feat(core): add IGameState, IEvents, WorldEvents with replay-on-subscribe 2026-04-10 20:29:29 +02:00
Rendering #119 ROOT CAUSE: interior-id X-byte collision + player-landblock cache hints = cross-entity batch serving 2026-06-11 21:43:45 +02:00
Selection test(picker): Cluster A #86 — screen-rect cell-occlusion tests 2026-05-19 14:56:51 +02:00
Spells fix(player): EnchantmentMask bit fix + Vitae key=0 + absolute Vitals overlay 2026-04-25 18:15:20 +02:00
Streaming fix(G.3): pre-collapse dungeon streaming at login/teleport — kill the login FPS ramp (#135) 2026-06-14 16:46:56 +02:00
Terrain fix #108-residual (root cause): terrain drew DOUBLE-SIDED - port retail landPolysDraw eye-side gate as terrain backface cull 2026-06-12 22:05:31 +02:00
Textures feat(O-T2): extract pure stateless helpers to AcDream.Core.Rendering.Wb 2026-05-21 15:13:26 +02:00
Ui fix(retail): rotation rate, useability gate, retail toast strings 2026-05-16 12:17:54 +02:00
Vfx fix(vfx #56): ParticleHookSink applies CreateParticleHook.PartIndex transform 2026-05-11 23:57:20 +02:00
World #119: entity bounds from dat vertex data - works for every case, not just multi-part 2026-06-11 22:39:05 +02:00
AcDream.Core.Tests.csproj test: fix PhysicsResolveCapture/PhysicsDiagnostics static-leak isolation 2026-06-02 15:20:24 +02:00
SmokeTest.cs chore: phase 1 — add Core, Abstractions, App, Tests projects 2026-04-10 09:22:33 +02:00
xunit.runner.json test: fix PhysicsResolveCapture/PhysicsDiagnostics static-leak isolation 2026-06-02 15:20:24 +02:00