From b93103885ae6c362829aa2f1bb8a5385cedc7ac8 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 27 May 2026 10:07:15 +0200 Subject: [PATCH] =?UTF-8?q?Revert=20"fix(render):=20Phase=20A8=20R3.5=20?= =?UTF-8?q?=E2=80=94=20gate=20stencil=20branch=20on=20PointInCell=20contai?= =?UTF-8?q?nment"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 38d537491f24733dd08df0979797316b58568476. --- src/AcDream.App/Rendering/GameWindow.cs | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index 1f0177b..bd54b28 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -7179,29 +7179,7 @@ public sealed class GameWindow : IDisposable animatedIds.Add(k); } - // Phase A8 R3.5 — transition-flicker fix. `cameraInsideCell` - // stays true for ~3 grace frames after the camera physically - // exits a cell (see CellVisibility._cellSwitchGraceFrames). - // The grace mechanism prevents lighting/sky flicker at the - // doorway threshold, but if the stencil pipeline runs during - // grace frames it marks/punches at the OLD cell's portal - // silhouettes — which are now behind/beside the camera — and - // the subsequent IndoorPass + stencil-gated outdoor produce - // a brief frame of "walls disappear + buildings under ground" - // garbage. Gate the stencil branch on the stricter - // `PointInCell` containment check so the pipeline only runs - // when the camera is ACTUALLY inside its cell volume; sky / - // lighting / depth-clear continue to use `cameraInsideCell` - // for their smoother grace-aware behavior. - bool cameraReallyInside = visibility?.CameraCell is not null - && CellVisibility.PointInCell(camPos, visibility.CameraCell); - - // The `visibility?.CameraCell is not null` repeat is for the - // compiler's null-flow analysis: `cameraReallyInside` already - // implies it, but flow doesn't propagate through a separate - // local. Restating it inside the if condition lets the branch - // body use the un-`?`d form without null-forgiving. - if (cameraReallyInside && _indoorStencilPipeline is not null + if (cameraInsideCell && _indoorStencilPipeline is not null && visibility?.CameraCell is not null) { if (AcDream.Core.Rendering.RenderingDiagnostics.ProbeVisibilityEnabled)