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
359 int nextLineIndex = (i + 1) * sizeWithSkirt;359 int nextLineIndex = (i + 1) * sizeWithSkirt;
360 for (int j = 0; j < rows; j++) {360 for (int j = 0; j < rows; j++) {
361 *index++ = lineIndex + j;361 *index++ = lineIndex + j;
362 *index++ = lineIndex + j + 1;
363 *index++ = nextLineIndex + j + 1;
364 *index++ = nextLineIndex + j;362 *index++ = nextLineIndex + j;
363 *index++ = nextLineIndex + j + 1;
364 *index++ = lineIndex + j + 1;
365 }365 }
366 }366 }
367 367
@@ -405,6 +405,7 @@ QHash<int, HeightfieldBuffer::BufferPair> HeightfieldBuffer::_bufferPairs; · 37 unmodified lines
405 405
406void HeightfieldPreview::render(const glm::vec3& translation, float scale) const {406void HeightfieldPreview::render(const glm::vec3& translation, float scale) const {
407 glDisable(GL_BLEND);407 glDisable(GL_BLEND);
408 glEnable(GL_CULL_FACE);
408 glEnable(GL_ALPHA_TEST);409 glEnable(GL_ALPHA_TEST);
409 glAlphaFunc(GL_EQUAL, 0.0f);410 glAlphaFunc(GL_EQUAL, 0.0f);
410 411
@@ -431,6 +432,7 @@ void HeightfieldPreview::render(const glm::vec3& translation, float scale) const · 20 unmodified lines
431 glDisableClientState(GL_VERTEX_ARRAY);432 glDisableClientState(GL_VERTEX_ARRAY);
432 433
433 glDisable(GL_ALPHA_TEST);434 glDisable(GL_ALPHA_TEST);
435 glDisable(GL_CULL_FACE);
434 glEnable(GL_BLEND);436 glEnable(GL_BLEND);
435}437}
436 438
@@ -737,6 +739,7 @@ void DefaultMetavoxelRendererImplementation::render(MetavoxelData& data, Metavox · 300 unmodified lines
737 739
738 _pointProgram.release();740 _pointProgram.release();
739 741
742 glEnable(GL_CULL_FACE);
740 glEnable(GL_ALPHA_TEST);743 glEnable(GL_ALPHA_TEST);
741 glAlphaFunc(GL_EQUAL, 0.0f);744 glAlphaFunc(GL_EQUAL, 0.0f);
742 745
@@ -756,6 +759,7 @@ void DefaultMetavoxelRendererImplementation::render(MetavoxelData& data, Metavox · 13 unmodified lines
756 glDisableClientState(GL_VERTEX_ARRAY);759 glDisableClientState(GL_VERTEX_ARRAY);
757 760
758 glDisable(GL_ALPHA_TEST);761 glDisable(GL_ALPHA_TEST);
762 glDisable(GL_CULL_FACE);
759 glEnable(GL_BLEND);763 glEnable(GL_BLEND);
760}764}
761 765