refactor(render): cull terrain by walk in-view cells

This commit is contained in:
Erik 2026-08-31 04:54:03 +02:00
parent 98d2d43fdc
commit 837a33baff
3 changed files with 54 additions and 14 deletions

View file

@ -10,6 +10,11 @@ namespace AcDream.App.Rendering;
/// methods — the cutover changes ORDER only.</summary>
internal sealed partial class RetailPViewPassExecutor
{
private IReadOnlySet<uint>? _walkTerrainInViewLandcells;
internal void SetWalkTerrainInViewLandcells(IReadOnlySet<uint>? cells) =>
_walkTerrainInViewLandcells = cells;
/// <summary>The walk's single sky turn: retail draws GameSky once
/// inside <c>LScape::draw</c>, clipped by the active views; looping
/// today's per-slice scissor + terrain-clip block reproduces today's
@ -105,7 +110,8 @@ internal sealed partial class RetailPViewPassExecutor
frame.Frustum,
neverCullLandblockId: frame.PlayerLandblockId,
clipPlanes: default,
ndcClipAabb: new Vector4(-1f, -1f, 1f, 1f));
ndcClipAabb: new Vector4(-1f, -1f, 1f, 1f),
inViewLandcells: _walkTerrainInViewLandcells);
_terrainDiagnostics.Complete();
return;
}
@ -120,7 +126,8 @@ internal sealed partial class RetailPViewPassExecutor
frame.Frustum,
neverCullLandblockId: frame.PlayerLandblockId,
clipPlanes: slice.Planes,
ndcClipAabb: slice.NdcAabb);
ndcClipAabb: slice.NdcAabb,
inViewLandcells: _walkTerrainInViewLandcells);
_terrainDiagnostics.Complete();
DisableClipDistances();
if (scissor)