- use a higher depth bias for non-orthogonal wall sprites.

Due to minor angular inaccuracies they are more sensitive to z-ordering than orthogonal ones when things are closely stacked.
This commit is contained in:
Christoph Oelckers 2021-05-21 12:55:18 +02:00
parent d572e56839
commit 079a95a0a3

View file

@ -235,9 +235,10 @@ void HWWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
state.SetNpotEmulation(float(h2) / h, xOffset); state.SetNpotEmulation(float(h2) / h, xOffset);
} }
} }
else if (walldist >= 0 && !(rflags & RWF_TRANS)) else if (!(rflags & RWF_TRANS))
{ {
state.SetDepthBias(-1, -128); if (walldist >= 0) state.SetDepthBias(-1, glseg.x1 == glseg.x2 || glseg.y1 == glseg.y2? -128 : -192);
else state.ClearDepthBias();
} }
RenderWall(di, state, rflags); RenderWall(di, state, rflags);
@ -1138,6 +1139,7 @@ void HWWall::ProcessWallSprite(HWDrawInfo* di, spritetype* spr, sectortype* sect
height = (int)tex->GetDisplayHeight(); height = (int)tex->GetDisplayHeight();
topofs = ((int)tex->GetDisplayTopOffset() + spr->yoffset); topofs = ((int)tex->GetDisplayTopOffset() + spr->yoffset);
} }
walldist = IsOnWall(spr, height); walldist = IsOnWall(spr, height);
if (spr->cstat & CSTAT_SPRITE_YFLIP) if (spr->cstat & CSTAT_SPRITE_YFLIP)