Bläddra i källkod

Update DebugRenderer comments. Render lines with depth write on and solid triangles with depth write off.

Lasse Öörni 9 år sedan
förälder
incheckning
df808db28d
2 ändrade filer med 6 tillägg och 5 borttagningar
  1. 2 1
      Source/Urho3D/Graphics/DebugRenderer.cpp
  2. 4 4
      Source/Urho3D/Graphics/DebugRenderer.h

+ 2 - 1
Source/Urho3D/Graphics/DebugRenderer.cpp

@@ -541,7 +541,7 @@ void DebugRenderer::Render()
     graphics->SetBlendMode(lineAntiAlias_ ? BLEND_ALPHA : BLEND_REPLACE);
     graphics->SetColorWrite(true);
     graphics->SetCullMode(CULL_NONE);
-    graphics->SetDepthWrite(false);
+    graphics->SetDepthWrite(true);
     graphics->SetLineAntiAlias(lineAntiAlias_);
     graphics->SetScissorTest(false);
     graphics->SetStencilTest(false);
@@ -571,6 +571,7 @@ void DebugRenderer::Render()
     }
 
     graphics->SetBlendMode(BLEND_ALPHA);
+    graphics->SetDepthWrite(false);
 
     if (triangles_.Size())
     {

+ 4 - 4
Source/Urho3D/Graphics/DebugRenderer.h

@@ -112,13 +112,13 @@ public:
     void AddLine(const Vector3& start, const Vector3& end, const Color& color, bool depthTest = true);
     /// Add a line with color already converted to unsigned.
     void AddLine(const Vector3& start, const Vector3& end, unsigned color, bool depthTest = true);
-    /// Add a triangle.
+    /// Add a solid triangle.
     void AddTriangle(const Vector3& v1, const Vector3& v2, const Vector3& v3, const Color& color, bool depthTest = true);
-    /// Add a triangle with color already converted to unsigned.
+    /// Add a solid triangle with color already converted to unsigned.
     void AddTriangle(const Vector3& v1, const Vector3& v2, const Vector3& v3, unsigned color, bool depthTest = true);
-    /// Add a quadrangular polygon.
+    /// Add a solid quadrangular polygon.
     void AddPolygon(const Vector3& v1, const Vector3& v2, const Vector3& v3, const Vector3& v4, const Color& color, bool depthTest = true);
-    /// Add a quadrangular polygon with color already converted to unsigned.
+    /// Add a solid quadrangular polygon with color already converted to unsigned.
     void AddPolygon(const Vector3& v1, const Vector3& v2, const Vector3& v3, const Vector3& v4, unsigned color, bool depthTest = true);
     /// Add a scene node represented as its coordinate axes.
     void AddNode(Node* node, float scale = 1.0f, bool depthTest = true);