mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-19 07:31:03 +00:00
- fixed rendering of non-orthogonal wall sprites.
These cannot be done in a simple two-pass approach, for wall sprites attached to walls it requires doing the two passes per wall to ensure proper depth buffer coverage.
This commit is contained in:
parent
2c3fcbaf51
commit
390cd2ca98
1 changed files with 21 additions and 0 deletions
|
@ -528,6 +528,27 @@ void HWDrawInfo::RenderScene(FRenderState &state)
|
|||
drawlists[GLDL_MASKEDWALLSS].DrawWalls(this, state, false);
|
||||
|
||||
// Each list must draw both its passes before the next one to ensure proper depth buffer contents.
|
||||
auto& list = drawlists[GLDL_MASKEDWALLSD].drawitems;
|
||||
unsigned i = 0;
|
||||
RenderWall.Clock();
|
||||
while (i < list.Size())
|
||||
{
|
||||
unsigned j;
|
||||
auto check = drawlists[GLDL_MASKEDWALLSD].walls[list[i].index]->walldist;
|
||||
state.SetDepthMask(false);
|
||||
for (j = i; j < list.Size() && drawlists[GLDL_MASKEDWALLSD].walls[list[j].index]->walldist == check; j++)
|
||||
{
|
||||
drawlists[GLDL_MASKEDWALLSD].walls[list[j].index]->DrawWall(this, state, false);
|
||||
}
|
||||
state.SetDepthMask(true);
|
||||
for (unsigned k = i; k < j; k++)
|
||||
{
|
||||
drawlists[GLDL_MASKEDWALLSD].walls[list[k].index]->DrawWall(this, state, false);
|
||||
}
|
||||
i = j;
|
||||
}
|
||||
RenderWall.Unclock();
|
||||
|
||||
state.SetDepthMask(false);
|
||||
drawlists[GLDL_MASKEDWALLSD].DrawWalls(this, state, false);
|
||||
state.SetDepthMask(true);
|
||||
|
|
Loading…
Reference in a new issue