diag(render): Phase U.4c — ACDREAM_PROBE_FLAP per-frame convergence probe

Per-frame (not cell-change-throttled, so it catches the flicker at a stable root):
[flap] line from the builder — root cell's per-portal side-test D + traverse/cull +
NDC projection, plus OutsideView poly count + visible-cell count; localEye exposes
when the eye has crossed an interior portal plane. Paired [flap-cam] line from the
draw site — FindCameraCell resolution branch (CameraCellResolution enum, new),
eyeInRoot AABB flag (stale-root signal), eye + player worldpos, and the frame's
TerrainMode/OutdoorVisible outcome. Disambiguates side-cull vs empty-projection vs
stale-root. Inert when off (gated). Throwaway apparatus to converge the flap fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-05-31 10:44:37 +02:00
parent 8941d1e6e5
commit 1d47ede007
4 changed files with 118 additions and 0 deletions

View file

@ -7315,6 +7315,22 @@ public sealed class GameWindow : IDisposable
clipAssembly.OutsidePlaneCount,
clipAssembly.PerCellPlaneCounts,
clipAssembly.ScissorFallbacks);
// Phase U.4c flap probe (ACDREAM_PROBE_FLAP) — paired with the builder's
// per-frame [flap] line. res = which FindCameraCell branch chose the root;
// eyeInRoot = is the EYE actually inside clipRoot's AABB (n ⇒ stale root via
// cache/grace, the leading flap hypothesis); terrain/outVisible = the frame's
// outcome (Skip/false ⇒ terrain+shells flapped off this frame).
if (AcDream.Core.Rendering.RenderingDiagnostics.ProbeFlapEnabled)
{
var flapPlayer = _playerController?.Position ?? camPos;
bool eyeInRoot = CellVisibility.PointInCell(camPos, clipRoot);
Console.WriteLine(
$"[flap-cam] root=0x{clipRoot.CellId:X8} res={_cellVisibility.LastCameraCellResolution} " +
$"eyeInRoot={(eyeInRoot ? "Y" : "n")} eye=({camPos.X:F2},{camPos.Y:F2},{camPos.Z:F2}) " +
$"player=({flapPlayer.X:F2},{flapPlayer.Y:F2},{flapPlayer.Z:F2}) " +
$"terrain={clipAssembly.TerrainMode} outVisible={clipAssembly.OutdoorVisible}");
}
}
else
{