fix(render): outdoor-root skips the full-screen depth clear (cellar/buildings no longer draw over the world)
Cutover-flip follow-up (issues 1+2 from the visual gate). After the flip an outdoor-node frame ran DrawInside with a full-screen OutsideView slice (Step A) whose ClearDepthSlice wiped the ENTIRE depth buffer AFTER terrain/exteriors/player drew — so the flooded building interior shells (cellars) drew over everything: the cellar painted in front of the player from outside, and distant building interiors showed through the ground in the open field. The depth clear is a doorway look-in trick (clear a small door region so the cell seen through it draws over the terrain drawn through it). It is wrong for the full-screen base terrain of the outdoor root. Skip it there (ClearDepthSlice=null when clipRoot is the outdoor node); interiors now depth-test against terrain + exteriors and appear only through real door openings. Interior roots keep the doorway clear unchanged. App 216/0, build green. Visual gate pending (player must be outdoors to exercise the outdoor root). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
445e861163
commit
88caa0dc8b
1 changed files with 18 additions and 7 deletions
|
|
@ -7527,13 +7527,24 @@ public sealed class GameWindow : IDisposable
|
||||||
renderSky,
|
renderSky,
|
||||||
kf,
|
kf,
|
||||||
environOverrideActive),
|
environOverrideActive),
|
||||||
ClearDepthSlice = slice =>
|
// 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
|
||||||
bool zc = BeginDoorwayScissor(true, slice.NdcAabb);
|
// region (the indoor root looking out). For the OUTDOOR-node root the only
|
||||||
_gl.Clear(ClearBufferMask.DepthBufferBit);
|
// OutsideView slice is the FULL-SCREEN base terrain, so clearing its depth wipes the
|
||||||
if (zc)
|
// entire depth buffer AFTER terrain/exteriors/player drew — the flooded building
|
||||||
_gl.Disable(EnableCap.ScissorTest);
|
// 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 =>
|
DrawCellParticles = sliceCtx =>
|
||||||
DrawRetailPViewCellParticles(sliceCtx, camera, camPos),
|
DrawRetailPViewCellParticles(sliceCtx, camera, camPos),
|
||||||
EmitDiagnostics = result =>
|
EmitDiagnostics = result =>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue