- fixed depth buffer use of slope sprites.

They cannot be treated like perfectly horizontal floor sprites and need to write to the depth buffer in the same pass as the regular pixels.
This commit is contained in:
Christoph Oelckers 2022-01-03 21:10:04 +01:00
parent 8267f327e3
commit ac3546bdaa
3 changed files with 3 additions and 1 deletions

View file

@ -540,6 +540,7 @@ void HWDrawInfo::RenderScene(FRenderState &state)
state.SetColorMask(true);
state.SetDepthBias(-1, -128);
drawlists[GLDL_MASKEDSLOPEFLATS].DrawFlats(this, state, false);
state.SetDepthMask(false);
drawlists[GLDL_MASKEDFLATS].DrawFlats(this, state, false);
state.SetDepthMask(true);

View file

@ -77,6 +77,7 @@ enum DrawListType
GLDL_MASKEDWALLSV, // vertical wall sprites
GLDL_MASKEDWALLSH, // horizontal wall sprites. These two lists merely exist for easier sorting.
GLDL_MASKEDFLATS,
GLDL_MASKEDSLOPEFLATS,
GLDL_MODELS,
GLDL_TRANSLUCENT,

View file

@ -104,7 +104,7 @@ void HWDrawInfo::AddFlat(HWFlat *flat)
}
else
{
list = flat->Sprite ? GLDL_MASKEDFLATS : GLDL_PLAINFLATS;
list = flat->Sprite ? ((flat->Sprite->clipdist & TSPR_SLOPESPRITE)? GLDL_MASKEDSLOPEFLATS : GLDL_MASKEDFLATS) : GLDL_PLAINFLATS;
}
auto newflat = drawlists[list].NewFlat(slopespr);
*newflat = *flat;