diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index 481eb6fe..a1a96a34 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -7527,13 +7527,24 @@ public sealed class GameWindow : IDisposable renderSky, kf, environOverrideActive), - ClearDepthSlice = slice => - { - bool zc = BeginDoorwayScissor(true, slice.NdcAabb); - _gl.Clear(ClearBufferMask.DepthBufferBit); - if (zc) - _gl.Disable(EnableCap.ScissorTest); - }, + // The depth clear is a doorway "look-in" trick: clear depth inside a door/window + // region so the cell seen THROUGH it draws over the terrain drawn through that + // region (the indoor root looking out). For the OUTDOOR-node root the only + // OutsideView slice is the FULL-SCREEN base terrain, so clearing its depth wipes the + // entire depth buffer AFTER terrain/exteriors/player drew — the flooded building + // interiors (cellars) would then paint over everything (cellar in front of the + // player; building interiors through the ground). Outdoors the interiors must + // depth-test against terrain+exteriors and appear only through real door openings, + // so issue NO depth clear. Interior roots keep the doorway clear (unchanged). + ClearDepthSlice = ReferenceEquals(clipRoot, _outdoorNode) + ? null + : slice => + { + bool zc = BeginDoorwayScissor(true, slice.NdcAabb); + _gl.Clear(ClearBufferMask.DepthBufferBit); + if (zc) + _gl.Disable(EnableCap.ScissorTest); + }, DrawCellParticles = sliceCtx => DrawRetailPViewCellParticles(sliceCtx, camera, camPos), EmitDiagnostics = result =>