Browse Source

Fix smoke ring rendering depth — enable depth testing and increase polygon offset

The smoke rings were rendering on top of buildings because depth testing was disabled.
This fix enables depth testing (while keeping depth writes disabled for transparency)
and increases the polygon offset to properly position the smoke between ground and buildings.

Co-authored-by: djeada <[email protected]>
copilot-swe-agent[bot] 2 months ago
parent
commit
0ee7b93a1c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      render/gl/backend.cpp

+ 2 - 2
render/gl/backend.cpp

@@ -550,9 +550,9 @@ void Backend::execute(const DrawQueue &queue, const Camera &cam) {
       m_basicShader->setUniform(m_basicUniforms.useTexture, false);
       m_basicShader->setUniform(m_basicUniforms.color, sm.color);
       DepthMaskScope depthMask(false);
-      DepthTestScope depthTest(false);
+      DepthTestScope depthTest(true);
 
-      PolygonOffsetScope poly(-0.1f, -0.1f);
+      PolygonOffsetScope poly(-1.0f, -1.0f);
       BlendScope blend(true);
       for (int i = 0; i < 7; ++i) {
         float scale = 1.35f + 0.12f * i;