From c42fc15999aa853f08a4bfc7178e0ea3be8ca2a1 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Tue, 5 Aug 2014 11:13:15 -0700 Subject: [PATCH] Use back face culling on the heightfields. --- interface/src/MetavoxelSystem.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/interface/src/MetavoxelSystem.cpp b/interface/src/MetavoxelSystem.cpp index 666a3336ac..7aa6bc4080 100644 --- a/interface/src/MetavoxelSystem.cpp +++ b/interface/src/MetavoxelSystem.cpp @@ -359,9 +359,9 @@ void HeightfieldBuffer::render() { int nextLineIndex = (i + 1) * sizeWithSkirt; for (int j = 0; j < rows; j++) { *index++ = lineIndex + j; - *index++ = lineIndex + j + 1; - *index++ = nextLineIndex + j + 1; *index++ = nextLineIndex + j; + *index++ = nextLineIndex + j + 1; + *index++ = lineIndex + j + 1; } } @@ -405,6 +405,7 @@ QHash HeightfieldBuffer::_bufferPairs; void HeightfieldPreview::render(const glm::vec3& translation, float scale) const { glDisable(GL_BLEND); + glEnable(GL_CULL_FACE); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_EQUAL, 0.0f); @@ -431,6 +432,7 @@ void HeightfieldPreview::render(const glm::vec3& translation, float scale) const glDisableClientState(GL_VERTEX_ARRAY); glDisable(GL_ALPHA_TEST); + glDisable(GL_CULL_FACE); glEnable(GL_BLEND); } @@ -737,6 +739,7 @@ void DefaultMetavoxelRendererImplementation::render(MetavoxelData& data, Metavox _pointProgram.release(); + glEnable(GL_CULL_FACE); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_EQUAL, 0.0f); @@ -756,6 +759,7 @@ void DefaultMetavoxelRendererImplementation::render(MetavoxelData& data, Metavox glDisableClientState(GL_VERTEX_ARRAY); glDisable(GL_ALPHA_TEST); + glDisable(GL_CULL_FACE); glEnable(GL_BLEND); }