From 8be6a37fea0699a1f4888260b24abfc1693c97c6 Mon Sep 17 00:00:00 2001 From: eihrul Date: Fri, 2 Oct 2009 02:55:06 +0000 Subject: [PATCH] enable backface culling for shadowmap rendering git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9275 d7cf8633-e32d-0410-b094-e92efae38249 --- r_shadow.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/r_shadow.c b/r_shadow.c index 7f6c212c..79f177ff 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -1700,7 +1700,13 @@ void R_Shadow_RenderMode_ShadowMap(int side, qboolean clear, int size) CHECKGLERROR R_SetViewport(&viewport); GL_PolygonOffset(0, 0); - GL_CullFace(GL_NONE); // quake is backwards + if(r_shadow_shadowmode >= 1 && r_shadow_shadowmode <= 2) + { + static qboolean cullback[6] = { true, false, true, false, false, true }; + GL_CullFace(cullback[side] ? r_refdef.view.cullface_back : r_refdef.view.cullface_front); + } + else if(r_shadow_shadowmode == 3) + GL_CullFace(r_refdef.view.cullface_back); GL_Scissor(viewport.x, viewport.y, viewport.width, viewport.height); GL_DepthMask(true); GL_DepthTest(true); -- 2.39.2