From 2d0360fa559408fcfcaa0f61dea71304f0259aee Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 29 Mar 2021 19:45:04 +0200 Subject: [PATCH] - apply depth bias to translucent geometry. This is necessary to handle wall and floor sprites placed on actual walls and floors work as intended. --- source/core/rendering/scene/hw_drawinfo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/core/rendering/scene/hw_drawinfo.cpp b/source/core/rendering/scene/hw_drawinfo.cpp index 650c7c0d7..01c91a642 100644 --- a/source/core/rendering/scene/hw_drawinfo.cpp +++ b/source/core/rendering/scene/hw_drawinfo.cpp @@ -486,6 +486,8 @@ void HWDrawInfo::RenderTranslucent(FRenderState &state) { RenderAll.Clock(); + state.SetDepthBias(-1, -128); + // final pass: translucent stuff state.AlphaFunc(Alpha_GEqual, gl_mask_sprite_threshold); state.SetRenderStyle(STYLE_Translucent); @@ -497,7 +499,7 @@ void HWDrawInfo::RenderTranslucent(FRenderState &state) drawlists[GLDL_TRANSLUCENT].DrawSorted(this, state); state.EnableBrightmap(false); - + state.ClearDepthBias(); state.AlphaFunc(Alpha_GEqual, 0.5f); state.SetDepthMask(true);