fix(render): clip walk content to authored portal views
This commit is contained in:
parent
90eba0ec3c
commit
11e68aad82
10 changed files with 408 additions and 78 deletions
|
|
@ -209,6 +209,7 @@ internal sealed class WalkProductionLeafRenderer : IWalkFrameLeafRenderer
|
|||
private readonly Action _drawExitSeals;
|
||||
private readonly HashSet<uint> _singleCellScratch = new();
|
||||
private readonly List<uint> _singleCellListScratch = new();
|
||||
private readonly Dictionary<uint, int> _singleCellClipScratch = new(1);
|
||||
|
||||
internal WalkProductionLeafRenderer(
|
||||
RetailPViewPassExecutor passes,
|
||||
|
|
@ -231,16 +232,26 @@ internal sealed class WalkProductionLeafRenderer : IWalkFrameLeafRenderer
|
|||
public void DrawTerrainSlice(int sliceIndex) =>
|
||||
_passes.DrawWalkTerrainSlice(_frame, _clipAssembly, sliceIndex);
|
||||
|
||||
public void DrawCellShell(uint cellId)
|
||||
public void DrawCellShell(uint cellId, uint clipSlot)
|
||||
{
|
||||
_singleCellScratch.Clear();
|
||||
_singleCellScratch.Add(cellId);
|
||||
_passes.DrawOpaqueCellShells(_singleCellScratch);
|
||||
if (_passes.CellHasTransparentShell(cellId))
|
||||
_singleCellClipScratch.Clear();
|
||||
_singleCellClipScratch.Add(cellId, checked((int)clipSlot));
|
||||
_passes.SetCellShellClipRouting(_singleCellClipScratch);
|
||||
try
|
||||
{
|
||||
_singleCellListScratch.Clear();
|
||||
_singleCellListScratch.Add(cellId);
|
||||
_passes.DrawTransparentCellShellsOrdered(_singleCellListScratch);
|
||||
_singleCellScratch.Clear();
|
||||
_singleCellScratch.Add(cellId);
|
||||
_passes.DrawOpaqueCellShells(_singleCellScratch);
|
||||
if (_passes.CellHasTransparentShell(cellId))
|
||||
{
|
||||
_singleCellListScratch.Clear();
|
||||
_singleCellListScratch.Add(cellId);
|
||||
_passes.DrawTransparentCellShellsOrdered(_singleCellListScratch);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_passes.SetCellShellClipRouting(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue