From 3b0881f9c1f7227c82f89b18f8511500df9cb1b5 Mon Sep 17 00:00:00 2001 From: Faerbit Date: Thu, 4 Dec 2014 13:23:25 +0100 Subject: [PATCH] Adding culling. --- graphics.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graphics.cc b/graphics.cc index 75f33b0..9f2bf18 100644 --- a/graphics.cc +++ b/graphics.cc @@ -57,6 +57,7 @@ void Graphics::render(Level* level) // render depth texture for sun framebuffer->bind(); glClear(GL_DEPTH_BUFFER_BIT); + glCullFace(GL_FRONT); depthShader->use(); glm::vec3 sunVector = (level->getCameraCenter()->getPosition() + level->getDirectionalLight()->getPosition()); glm::mat4 depthViewProjectionMatrix = glm::ortho(-20, 20, -20, 20, -20, 40) * @@ -70,6 +71,7 @@ void Graphics::render(Level* level) // final render pass glBindFramebuffer(GL_FRAMEBUFFER, 0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glCullFace(GL_BACK); lightingShader->use();