mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 04:57:58 +02:00
Use back face culling on the heightfields.
This commit is contained in:
parent
964dc4e954
commit
c42fc15999
1 changed files with 6 additions and 2 deletions
|
@ -359,9 +359,9 @@ void HeightfieldBuffer::render() {
|
||||||
int nextLineIndex = (i + 1) * sizeWithSkirt;
|
int nextLineIndex = (i + 1) * sizeWithSkirt;
|
||||||
for (int j = 0; j < rows; j++) {
|
for (int j = 0; j < rows; j++) {
|
||||||
*index++ = lineIndex + j;
|
*index++ = lineIndex + j;
|
||||||
*index++ = lineIndex + j + 1;
|
|
||||||
*index++ = nextLineIndex + j + 1;
|
|
||||||
*index++ = nextLineIndex + j;
|
*index++ = nextLineIndex + j;
|
||||||
|
*index++ = nextLineIndex + j + 1;
|
||||||
|
*index++ = lineIndex + j + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,6 +405,7 @@ QHash<int, HeightfieldBuffer::BufferPair> HeightfieldBuffer::_bufferPairs;
|
||||||
|
|
||||||
void HeightfieldPreview::render(const glm::vec3& translation, float scale) const {
|
void HeightfieldPreview::render(const glm::vec3& translation, float scale) const {
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
glEnable(GL_CULL_FACE);
|
||||||
glEnable(GL_ALPHA_TEST);
|
glEnable(GL_ALPHA_TEST);
|
||||||
glAlphaFunc(GL_EQUAL, 0.0f);
|
glAlphaFunc(GL_EQUAL, 0.0f);
|
||||||
|
|
||||||
|
@ -431,6 +432,7 @@ void HeightfieldPreview::render(const glm::vec3& translation, float scale) const
|
||||||
glDisableClientState(GL_VERTEX_ARRAY);
|
glDisableClientState(GL_VERTEX_ARRAY);
|
||||||
|
|
||||||
glDisable(GL_ALPHA_TEST);
|
glDisable(GL_ALPHA_TEST);
|
||||||
|
glDisable(GL_CULL_FACE);
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -737,6 +739,7 @@ void DefaultMetavoxelRendererImplementation::render(MetavoxelData& data, Metavox
|
||||||
|
|
||||||
_pointProgram.release();
|
_pointProgram.release();
|
||||||
|
|
||||||
|
glEnable(GL_CULL_FACE);
|
||||||
glEnable(GL_ALPHA_TEST);
|
glEnable(GL_ALPHA_TEST);
|
||||||
glAlphaFunc(GL_EQUAL, 0.0f);
|
glAlphaFunc(GL_EQUAL, 0.0f);
|
||||||
|
|
||||||
|
@ -756,6 +759,7 @@ void DefaultMetavoxelRendererImplementation::render(MetavoxelData& data, Metavox
|
||||||
glDisableClientState(GL_VERTEX_ARRAY);
|
glDisableClientState(GL_VERTEX_ARRAY);
|
||||||
|
|
||||||
glDisable(GL_ALPHA_TEST);
|
glDisable(GL_ALPHA_TEST);
|
||||||
|
glDisable(GL_CULL_FACE);
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue