From 225fa5951b563735a5c3684ec6e963a49e35d584 Mon Sep 17 00:00:00 2001 From: arcattack Date: Mon, 13 Jul 2026 21:36:48 -0500 Subject: [PATCH] Render: fog searchlight-swap verified INERT + BT_FOG_LOG diag (task #63) Verifying the searchlight/nosearchlightfog swap (user request): it does NOT work. The arcade swaps active fog between fog= (headlight on) and nosearchlightfog= (off, darker/tighter) via PullFogRenderable::Execute (edge-triggered on the mech's light attrs -> SetFogStyle searchLightOn/Off). But PullFogRenderable is NEVER CONSTRUCTED in the port (grep: only the .h decl + .cpp def; no `new`), and searchLightOn/Off is called from nowhere else. Empirical confirmation via the new BT_FOG_LOG hook: over a 22s run SetFogStyle fired only style 0, zero style 2/3. So fog is static at the searchlight-ON (fog=) values -- normal lights-on play, so core per-map/time/weather fog is unaffected -- but the nosearchlightfog variant is dead. Corrects my earlier "the swap is wired end-to-end" claim (code paths exist, trigger never instantiated). KB rendering.md updated; wiring it back is a scoped reconstruction (bind the Searchlight subsys light state to a constructed PullFogRenderable at viewpoint setup). No behavior change this commit -- diag only. Co-Authored-By: Claude Opus 4.8 (1M context) --- context/rendering.md | 11 ++++++++++- engine/MUNGA_L4/L4VIDEO.cpp | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/context/rendering.md b/context/rendering.md index fa87321..ba52583 100644 --- a/context/rendering.md +++ b/context/rendering.md @@ -66,7 +66,16 @@ DECLOUDS must stay in the sky pass). Authored TEXTURE **SCROLL** (BMF TEXTURE ta fog" was WRONG** — it checked `.MAP`/`.RES`, but fog lives in BTDPL.INI (the DPL env INI), as in the arcade. Night fog is dark BY DESIGN (distance→murk, not light haze); day pages author light haze. Env: `BT_FOGMODE=table|vertex|off`, `BT_WEATHER=clear|fog|soup`, `BT_FOG="near far r g b"` (all branches); - `[fog] resolved`/`[fog] model` log lines. [T1 pipeline / T0 arcade model / T2 fix] + `[fog] resolved`/`[fog] model`/`[fogstyle]` (BT_FOG_LOG) log lines. [T1 pipeline / T0 arcade model / T2 fix] + **⚠ SEARCHLIGHT SWAP IS INERT [T1, verified 2026-07-13].** The arcade swaps the active fog between + `fog=` (headlight ON) and `nosearchlightfog=` (OFF, darker/tighter) via `PullFogRenderable::Execute` + (L4VIDRND.cpp:4601, edge-triggered on two light attrs → `SetFogStyle(searchLightOn/OffFogStyle)`). In + the port **`PullFogRenderable` is NEVER CONSTRUCTED** (grep: only its .h decl + .cpp def; no `new`), and + `searchLightOn/Off` is called from nowhere else — so the swap never fires (BT_FOG_LOG: over 22s only + `SetFogStyle(0)`, zero style 2/3). Fog is STATIC at the searchlight-ON (`fog=`) values; the + `nosearchlightfog=` variant is dead. Reconstruction gap: wiring needs the mech's headlight/searchlight + state (Searchlight subsys 3032) bound to a `PullFogRenderable` constructed at viewpoint/mech setup. + Core per-map/time/weather fog is unaffected (uses the lights-ON set, the normal play state). - **Projection / stencil (task #55):** the BTDPL.INI `viewangle=60` is the **HORIZONTAL** FOV — authentic 60×47 frustum at 4:3; fovY derived via `BTFovYFromHorizontal` (L4VIDEO.cpp), applied at all 5 projection sites (it was mis-applied as vertical). The device depth-stencil is now diff --git a/engine/MUNGA_L4/L4VIDEO.cpp b/engine/MUNGA_L4/L4VIDEO.cpp index a122a8d..81eb4cb 100644 --- a/engine/MUNGA_L4/L4VIDEO.cpp +++ b/engine/MUNGA_L4/L4VIDEO.cpp @@ -4077,6 +4077,10 @@ void void DPLRenderer::SetFogStyle(FogStyle my_fog) { + if (getenv("BT_FOG_LOG")) + DEBUG_STREAM << "[fogstyle] SetFogStyle(" << (int)my_fog + << ") 0=update 1=noUpdate 2=searchLightOn 3=searchLightOff 4=winnersCircle\n" + << std::flush; //STUBBED: DPL RB 1/14/07 switch(my_fog) {