Browse Source

Fix render order and depth buffer issues for selection rings and pine trees

Co-authored-by: djeada <[email protected]>
copilot-swe-agent[bot] 1 month ago
parent
commit
634786a0fe
2 changed files with 7 additions and 7 deletions
  1. 5 5
      render/draw_queue.h
  2. 2 2
      render/gl/backend.cpp

+ 5 - 5
render/draw_queue.h

@@ -255,11 +255,11 @@ private:
       StoneBatch = 2,
       PlantBatch = 3,
       PineBatch = 4,
-      FogBatch = 5,
-      Mesh = 6,
-      Cylinder = 7,
-      SelectionSmoke = 8,
-      SelectionRing = 9,
+      SelectionRing = 5,
+      FogBatch = 6,
+      Mesh = 7,
+      Cylinder = 8,
+      SelectionSmoke = 9,
       Grid = 10
     };
 

+ 2 - 2
render/gl/backend.cpp

@@ -405,7 +405,7 @@ void Backend::execute(const DrawQueue &queue, const Camera &cam) {
         break;
       }
 
-      DepthMaskScope depthMask(false);
+      DepthMaskScope depthMask(true);
       glEnable(GL_DEPTH_TEST);
       BlendScope blend(true);
       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -688,7 +688,7 @@ void Backend::execute(const DrawQueue &queue, const Camera &cam) {
       m_basicShader->setUniform(m_basicUniforms.color, sc.color);
 
       DepthMaskScope depthMask(false);
-      DepthTestScope depthTest(false);
+      DepthTestScope depthTest(true);
       PolygonOffsetScope poly(-1.0f, -1.0f);
       BlendScope blend(true);