History

Use back face culling on the heightfields.

Andrzej Kapolka committed 12 years ago

Commit c42fc151 parent 964dc4e1 file · +6 −2Browse files

Showing the changes to interface/src/MetavoxelSystem.cpp (1 of 1 file). Show all

Unified · Split

interface/src/MetavoxelSystem.cpp+6−2
@@ -359,9 +359,9 @@ void HeightfieldBuffer::render() { · 358 unmodified lines
359359 int nextLineIndex = (i + 1) * sizeWithSkirt;
360360 for (int j = 0; j < rows; j++) {
361361 *index++ = lineIndex + j;
362− *index++ = lineIndex + j + 1;
363− *index++ = nextLineIndex + j + 1;
364362 *index++ = nextLineIndex + j;
363+ *index++ = nextLineIndex + j + 1;
364+ *index++ = lineIndex + j + 1;
365365 }
366366 }
367367
@@ -405,6 +405,7 @@ QHash<int, HeightfieldBuffer::BufferPair> HeightfieldBuffer::_bufferPairs; · 37 unmodified lines
405405
406406 void HeightfieldPreview::render(const glm::vec3& translation, float scale) const {
407407 glDisable(GL_BLEND);
408+ glEnable(GL_CULL_FACE);
408409 glEnable(GL_ALPHA_TEST);
409410 glAlphaFunc(GL_EQUAL, 0.0f);
410411
@@ -431,6 +432,7 @@ void HeightfieldPreview::render(const glm::vec3& translation, float scale) const · 20 unmodified lines
431432 glDisableClientState(GL_VERTEX_ARRAY);
432433
433434 glDisable(GL_ALPHA_TEST);
435+ glDisable(GL_CULL_FACE);
434436 glEnable(GL_BLEND);
435437 }
436438
@@ -737,6 +739,7 @@ void DefaultMetavoxelRendererImplementation::render(MetavoxelData& data, Metavox · 300 unmodified lines
737739
738740 _pointProgram.release();
739741
742+ glEnable(GL_CULL_FACE);
740743 glEnable(GL_ALPHA_TEST);
741744 glAlphaFunc(GL_EQUAL, 0.0f);
742745
@@ -756,6 +759,7 @@ void DefaultMetavoxelRendererImplementation::render(MetavoxelData& data, Metavox · 13 unmodified lines
756759 glDisableClientState(GL_VERTEX_ARRAY);
757760
758761 glDisable(GL_ALPHA_TEST);
762+ glDisable(GL_CULL_FACE);
759763 glEnable(GL_BLEND);
760764 }
761765