From: eihrul Date: Fri, 2 Oct 2009 02:55:06 +0000 (+0000) Subject: enable backface culling for shadowmap rendering X-Git-Tag: xonotic-v0.1.0preview~1358 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8be6a37fea0699a1f4888260b24abfc1693c97c6;p=xonotic%2Fdarkplaces.git enable backface culling for shadowmap rendering git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9275 d7cf8633-e32d-0410-b094-e92efae38249 --- 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);