summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-05-29 17:16:18 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-05-29 17:16:18 +0200
commit95314b6167d3ec8b15e028b62f6b4531f132b6e0 (patch)
tree12f402e7c83a07a792fd41a6ba8f80683660e266
parent5354f0c4e3bb157b63150c0e3415d0c3fdef8704 (diff)
Cull terrain faces.
-rw-r--r--scene.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene.cpp b/scene.cpp
index e981295..b669664 100644
--- a/scene.cpp
+++ b/scene.cpp
@@ -370,6 +370,9 @@ void Scene::render() {
//const float light_pos[4] = {0, 1, 0, 0};
//glLightfv(GL_LIGHT0, GL_POSITION, light_pos);
+ glEnable(GL_CULL_FACE);
+ glCullFace(GL_BACK);
+
if(render_terrain) {
const float fog_color[4] = {1, 1, 1, 0};
glFogfv(GL_FOG_COLOR, fog_color);
@@ -434,6 +437,7 @@ void Scene::render() {
// set active to texture0 to avoid breaking the texture font
glActiveTexture(GL_TEXTURE0);
+ glDisable(GL_CULL_FACE);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
water_program.use();