From 95314b6167d3ec8b15e028b62f6b4531f132b6e0 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sun, 29 May 2011 17:16:18 +0200 Subject: Cull terrain faces. --- scene.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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(); -- cgit v1.2.3