mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 10:07:58 +02:00
Add the discussed four lines to disable blending and enable backface culling.
This commit is contained in:
parent
85bca558f5
commit
0f2f4ee8f9
1 changed files with 7 additions and 0 deletions
|
@ -638,11 +638,18 @@ void VoxelSystem::render() {
|
||||||
_perlinModulateProgram->bind();
|
_perlinModulateProgram->bind();
|
||||||
glBindTexture(GL_TEXTURE_2D, _permutationNormalTextureID);
|
glBindTexture(GL_TEXTURE_2D, _permutationNormalTextureID);
|
||||||
|
|
||||||
|
// for performance, disable blending and enable backface culling
|
||||||
|
glDisable(GL_BLEND);
|
||||||
|
glEnable(GL_CULL_FACE);
|
||||||
|
|
||||||
// draw the number of voxels we have
|
// draw the number of voxels we have
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _vboIndicesID);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _vboIndicesID);
|
||||||
glScalef(TREE_SCALE, TREE_SCALE, TREE_SCALE);
|
glScalef(TREE_SCALE, TREE_SCALE, TREE_SCALE);
|
||||||
glDrawElements(GL_TRIANGLES, 36 * _voxelsInReadArrays, GL_UNSIGNED_INT, 0);
|
glDrawElements(GL_TRIANGLES, 36 * _voxelsInReadArrays, GL_UNSIGNED_INT, 0);
|
||||||
|
|
||||||
|
glEnable(GL_BLEND);
|
||||||
|
glDisable(GL_CULL_FACE);
|
||||||
|
|
||||||
_perlinModulateProgram->release();
|
_perlinModulateProgram->release();
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue