From aa311e85a3302d144aeef31529267d4ea06beef4 Mon Sep 17 00:00:00 2001 From: ousnius Date: Sat, 8 Oct 2016 23:37:01 +0200 Subject: [PATCH] Fix wireframe quality after rendering rewrite --- src/render/GLSurface.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/render/GLSurface.cpp b/src/render/GLSurface.cpp index 029b2157..144697d0 100644 --- a/src/render/GLSurface.cpp +++ b/src/render/GLSurface.cpp @@ -740,16 +740,15 @@ void GLSurface::RenderMesh(mesh* m) { } // Offset triangles so that points can be visible - if (m->bShowPoints) { - glEnable(GL_POLYGON_OFFSET_FILL); + glEnable(GL_POLYGON_OFFSET_FILL); + if (m->bShowPoints) glPolygonOffset(4.0f, 4.0f); - } + else + glPolygonOffset(0.03f, 0.03f); // Render mesh glDrawElements(GL_TRIANGLES, m->nTris * 3, GL_UNSIGNED_SHORT, (GLvoid*)0); - - if (m->bShowPoints) - glDisable(GL_POLYGON_OFFSET_FILL); + glDisable(GL_POLYGON_OFFSET_FILL); // Render wireframe if (bWireframe && m->rendermode == RenderMode::Normal) {