- use glPOlygonOffset on non-translucent flat and wall sprites to avoid z-fighting.

This commit is contained in:
Christoph Oelckers 2016-09-22 10:00:40 +02:00
parent 0a98fb0be7
commit 52d4c3970e

View file

@ -310,6 +310,11 @@ void GLSprite::Draw(int pass)
additivefog = true;
}
}
else if (modelframe == nullptr)
{
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(-1.0f, -128.0f);
}
if (RenderStyle.BlendOp!=STYLEOP_Shadow)
{
if (gl_lights && GLRenderer->mLightCount && !gl_fixedcolormap && !fullbright)
@ -440,6 +445,11 @@ void GLSprite::Draw(int pass)
gl_RenderState.BlendEquation(GL_FUNC_ADD);
gl_RenderState.SetTextureMode(TM_MODULATE);
}
else if (modelframe == nullptr)
{
glPolygonOffset(0.0f, 0.0f);
glDisable(GL_POLYGON_OFFSET_FILL);
}
gl_RenderState.SetObjectColor(0xffffffff);
gl_RenderState.EnableTexture(true);