History

Hide the unset (black) bits.

Andrzej Kapolka committed 12 years ago

Commit c3c22651 parent 6c154683 files · +20 −8Browse files

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

Unified · Split

interface/src/MetavoxelSystem.cpp+13−2
@@ -397,7 +397,11 @@ void HeightfieldBuffer::render() { · 396 unmodified lines
397397 QHash<int, HeightfieldBuffer::BufferPair> HeightfieldBuffer::_bufferPairs;
398398
399399 void HeightfieldPreview::render(const glm::vec3& translation, float scale) const {
400− glColor4f(1.0f, 1.0f, 1.0f, 0.75f);
400+ glDisable(GL_BLEND);
401+ glEnable(GL_ALPHA_TEST);
402+ glAlphaFunc(GL_EQUAL, 0.0f);
403+
404+ glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
401405
402406 glEnableClientState(GL_VERTEX_ARRAY);
403407 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
@@ -418,6 +422,9 @@ void HeightfieldPreview::render(const glm::vec3& translation, float scale) const · 14 unmodified lines
418422
419423 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
420424 glDisableClientState(GL_VERTEX_ARRAY);
425+
426+ glDisable(GL_ALPHA_TEST);
427+ glEnable(GL_BLEND);
421428 }
422429
423430 BufferDataAttribute::BufferDataAttribute(const QString& name) :
@@ -695,7 +702,10 @@ void DefaultMetavoxelRendererImplementation::render(MetavoxelData& data, Metavox · 271 unmodified lines
695702
696703 _pointProgram.release();
697704
698− glColor4f(1.0f, 1.0f, 1.0f, 0.0f);
705+ glEnable(GL_ALPHA_TEST);
706+ glAlphaFunc(GL_EQUAL, 0.0f);
707+
708+ glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
699709
700710 _heightfieldProgram.bind();
701711
@@ -710,6 +720,7 @@ void DefaultMetavoxelRendererImplementation::render(MetavoxelData& data, Metavox · 8 unmodified lines
710720 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
711721 glDisableClientState(GL_VERTEX_ARRAY);
712722
723+ glDisable(GL_ALPHA_TEST);
713724 glEnable(GL_BLEND);
714725 }
715726