From c897a179fab1b751c334f687b56c4af473371013 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 26 May 2026 09:38:36 +0200 Subject: [PATCH] =?UTF-8?q?Revert=20"fix(render):=20Phase=20A8=20=E2=80=94?= =?UTF-8?q?=20mark-and-punch=20BEFORE=20indoor=20draw=20(correct=20WB=20or?= =?UTF-8?q?der)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b76f6d112e1f05bd906bb463bf3a911cc81a350d. --- src/AcDream.App/Rendering/GameWindow.cs | 27 ++++++------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index 0dbcb49..464fbb0 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -7159,33 +7159,18 @@ public sealed class GameWindow : IDisposable if (cameraInsideCell && portalTriCount > 0) { - // Phase A8 fix (post-visual): the correct WB order is - // mark-and-punch FIRST, then indoor cells. The far-depth - // punch overwrites depth at portal silhouettes to 1.0; - // indoor geometry drawn AFTER the punch wins the depth - // test (its depth is closer than 1.0) and correctly - // occludes the subsequent stencil-gated outdoor pass. - // Drawing indoor first (the old order) had indoor depth - // destroyed by the punch, so terrain at 0.99 won every - // stencil-gated pixel: closed doors leaked outside, - // walls between rooms leaked far-side door openings, - // and characters bled to terrain at portal overlaps. - - // WB Steps 1+2: mark stencil + punch far depth in portal regions. - _indoorStencil!.MarkAndPunch(camera.View * camera.Projection); - - // WB Step 3: draw indoor entities second, stencil OFF - // (MarkAndPunch left the state stencil-disabled). Indoor - // entities ALWAYS draw inside the camera-building, regardless - // of portal coverage. Animated entities (player, NPCs) flow - // through IndoorOnly via the animatedEntityIds override so - // they're not stencil-gated by the outdoor pass. + // WB Step 3: draw indoor entities first, stencil OFF. + // Indoor entities (cell mesh + cell statics) ALWAYS draw + // inside the camera-building, regardless of portal coverage. _wbDrawDispatcher!.Draw(camera, _worldState.LandblockEntries, frustum, neverCullLandblockId: playerLb, visibleCellIds: visibility!.VisibleCellIds, animatedEntityIds: animatedIds, set: AcDream.App.Rendering.Wb.WbDrawDispatcher.EntitySet.IndoorOnly); + // WB Steps 1+2: mark stencil + punch far depth in portal regions. + _indoorStencil!.MarkAndPunch(camera.View * camera.Projection); + // WB Step 4a: terrain, stencil-gated to portal silhouettes. _indoorStencil!.EnableOutdoorPass(); // Phase N.5b: wrap Draw in CPU stopwatch for [TERRAIN-DIAG] rollup