summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2011-02-09 21:33:38 -0800
committerKenneth Graunke <kenneth@whitecape.org>2011-02-09 21:33:38 -0800
commitc0883a47666045005abed24e34daf25d2e328513 (patch)
tree325537d57901b0f96b251b98bbda68b49814d531
parent00a1a013acff250d59c66be1e2184897bd0e8dbc (diff)
Perform front-face culling when rendering the shadow map.
Helps some with the nasty shadow acne
-rwxr-xr-xsrc/main.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index e3a6461..21fe5a7 100755
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -43,12 +43,14 @@ static GLuint shadow_fbo;
static void
Redisplay()
{
+ glCullFace(GL_FRONT);
glBindFramebuffer(GL_FRAMEBUFFER, shadow_fbo);
glClear(GL_DEPTH_BUFFER_BIT);
Scene::Reshape(win_width/2, win_height/2);
Scene::RenderShadow();
// Render scene to FBO
+ glCullFace(GL_BACK);
glBindFramebuffer(GL_FRAMEBUFFER, main_fbo);
glClearColor(0.3, 0.3, 0.3, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);