- use a non-0 depth bias for sprites.

Hopefully this helps fixing the z-fighting issue with wall sprites in some Blood maps.
This commit is contained in:
Christoph Oelckers 2020-02-06 18:43:27 +01:00
parent 1479e1feae
commit 215cb14401
4 changed files with 46 additions and 1 deletions

View file

@ -428,6 +428,19 @@ void PolymostRenderState::Apply(PolymostShader* shader, GLState &oldState)
else
glDisable(GL_SCISSOR_TEST);
}
if (mBias.mChanged)
{
if (mBias.mFactor == 0 && mBias.mUnits == 0)
{
glDisable(GL_POLYGON_OFFSET_FILL);
}
else
{
glEnable(GL_POLYGON_OFFSET_FILL);
}
glPolygonOffset(mBias.mFactor, mBias.mUnits);
mBias.mChanged = false;
}
StateFlags &= ~(STF_CLEARCOLOR | STF_CLEARDEPTH | STF_VIEWPORTSET | STF_SCISSORSET);
oldState.Flags = StateFlags;