]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
enable backface culling for shadowmap rendering
authoreihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 2 Oct 2009 02:55:06 +0000 (02:55 +0000)
committereihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 2 Oct 2009 02:55:06 +0000 (02:55 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9275 d7cf8633-e32d-0410-b094-e92efae38249

r_shadow.c

index 7f6c212cfd241e61f29eb827f0ed40e721115cce..79f177ffe98628c491b7ea22a6e22ec63f8ae51a 100644 (file)
@@ -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);