From 6577c0a21ce505cf9899c01c2766f4e3c0ed87c2 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 26 May 2026 07:47:56 +0200 Subject: [PATCH] =?UTF-8?q?feat(render):=20Phase=20A8=20=E2=80=94=20Render?= =?UTF-8?q?ingDiagnostics.ProbeVisibilityEnabled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the ACDREAM_PROBE_VIS=1 env-var-toggleable flag for the indoor-cell visibility culling pipeline (#78). Mirrors the existing ProbeIndoor* pattern. DebugVM checkbox follows. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../Rendering/RenderingDiagnostics.cs | 10 +++++++ .../Panels/Debug/DebugVM.cs | 11 ++++++++ .../RenderingDiagnosticsVisibilityTests.cs | 27 +++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 tests/AcDream.Core.Tests/Rendering/RenderingDiagnosticsVisibilityTests.cs diff --git a/src/AcDream.Core/Rendering/RenderingDiagnostics.cs b/src/AcDream.Core/Rendering/RenderingDiagnostics.cs index ff0a32f..421552c 100644 --- a/src/AcDream.Core/Rendering/RenderingDiagnostics.cs +++ b/src/AcDream.Core/Rendering/RenderingDiagnostics.cs @@ -76,6 +76,16 @@ public static class RenderingDiagnostics Environment.GetEnvironmentVariable("ACDREAM_PROBE_INDOOR_CULL") == "1" || Environment.GetEnvironmentVariable("ACDREAM_PROBE_INDOOR_ALL") == "1"; + /// + /// Phase A8 (2026-05-25): when true, the indoor-cell stencil pipeline + /// emits one [vis] line per frame: camera-inside-cell flag, + /// VisibleCellIds count, HasExitPortalVisible flag, portal triangle + /// count uploaded, and which outdoor passes were stencil-gated. + /// Initial state from ACDREAM_PROBE_VIS=1. + /// + public static bool ProbeVisibilityEnabled { get; set; } = + Environment.GetEnvironmentVariable("ACDREAM_PROBE_VIS") == "1"; + /// /// Master toggle. Reading reflects the AND of all five flags /// (true only when every probe is on). Writing cascades — setting diff --git a/src/AcDream.UI.Abstractions/Panels/Debug/DebugVM.cs b/src/AcDream.UI.Abstractions/Panels/Debug/DebugVM.cs index a761738..d7801f4 100644 --- a/src/AcDream.UI.Abstractions/Panels/Debug/DebugVM.cs +++ b/src/AcDream.UI.Abstractions/Panels/Debug/DebugVM.cs @@ -345,6 +345,17 @@ public sealed class DebugVM set => RenderingDiagnostics.ProbeIndoorCullEnabled = value; } + /// + /// Phase A8 (2026-05-25). Runtime mirror of + /// RenderingDiagnostics.ProbeVisibilityEnabled + /// (env var ACDREAM_PROBE_VIS). + /// + public bool ProbeVisibility + { + get => RenderingDiagnostics.ProbeVisibilityEnabled; + set => RenderingDiagnostics.ProbeVisibilityEnabled = value; + } + /// /// Indoor walking Phase 1 (2026-05-19). Runtime mirror of /// PhysicsDiagnostics.ProbeIndoorBspEnabled (env var diff --git a/tests/AcDream.Core.Tests/Rendering/RenderingDiagnosticsVisibilityTests.cs b/tests/AcDream.Core.Tests/Rendering/RenderingDiagnosticsVisibilityTests.cs new file mode 100644 index 0000000..d0b96ee --- /dev/null +++ b/tests/AcDream.Core.Tests/Rendering/RenderingDiagnosticsVisibilityTests.cs @@ -0,0 +1,27 @@ +// Phase A8 — visibility probe flag tests. + +using System; +using AcDream.Core.Rendering; +using Xunit; + +namespace AcDream.Core.Tests.Rendering; + +public class RenderingDiagnosticsVisibilityTests +{ + [Fact] + public void ProbeVisibilityEnabled_CanBeToggled() + { + var prev = RenderingDiagnostics.ProbeVisibilityEnabled; + try + { + RenderingDiagnostics.ProbeVisibilityEnabled = true; + Assert.True(RenderingDiagnostics.ProbeVisibilityEnabled); + RenderingDiagnostics.ProbeVisibilityEnabled = false; + Assert.False(RenderingDiagnostics.ProbeVisibilityEnabled); + } + finally + { + RenderingDiagnostics.ProbeVisibilityEnabled = prev; + } + } +}