]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
use stencil shadows if r_shadows == 1
authoreihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 9 Mar 2010 02:51:39 +0000 (02:51 +0000)
committereihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 9 Mar 2010 02:51:39 +0000 (02:51 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10049 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c
r_shadow.c

index 4dda5da6386325df5b416d8a6824866e8bed56ec..160696f591f0e7ba29fb7cf692b7ac80cef1cfa8 100644 (file)
@@ -8602,7 +8602,7 @@ void R_RenderScene(void)
                        R_TimeReport("modeldepth");
        }
 
-       if (r_shadows.integer > 0 && shadowmapping && r_refdef.lightmapintensity > 0)
+       if (r_shadows.integer >= 2 && shadowmapping && r_refdef.lightmapintensity > 0)
        {
                R_DrawModelShadowMaps();
                R_ResetViewRendering3D();
@@ -8630,7 +8630,7 @@ void R_RenderScene(void)
        if (r_refdef.scene.extraupdate)
                S_ExtraUpdate ();
 
-       if (r_shadows.integer > 0 && !shadowmapping && !r_shadows_drawafterrtlighting.integer && r_refdef.lightmapintensity > 0)
+       if ((r_shadows.integer == 1 || (r_shadows.integer > 0 && !shadowmapping)) && !r_shadows_drawafterrtlighting.integer && r_refdef.lightmapintensity > 0)
        {
                R_DrawModelShadows();
                R_ResetViewRendering3D();
@@ -8650,7 +8650,7 @@ void R_RenderScene(void)
        if (r_refdef.scene.extraupdate)
                S_ExtraUpdate ();
 
-       if (r_shadows.integer > 0 && !shadowmapping && r_shadows_drawafterrtlighting.integer && r_refdef.lightmapintensity > 0)
+       if ((r_shadows.integer == 1 || (r_shadows.integer > 0 && !shadowmapping)) && r_shadows_drawafterrtlighting.integer && r_refdef.lightmapintensity > 0)
        {
                R_DrawModelShadows();
                R_ResetViewRendering3D();
index 9b1fbf83735fdb266b39c9ebbf8957af08f7504b..33c3005fe3c36385479a1143301b7ac09d3340e0 100644 (file)
@@ -4258,7 +4258,9 @@ void R_Shadow_PrepareModelShadows(void)
        {
        case R_SHADOW_SHADOWMODE_SHADOWMAP2D:
        case R_SHADOW_SHADOWMODE_SHADOWMAPRECTANGLE:
-               break;
+               if (r_shadows.integer >= 2) 
+                       break;
+               // fall through
        case R_SHADOW_SHADOWMODE_STENCIL:
                for (i = 0;i < r_refdef.scene.numentities;i++)
                {
@@ -4486,7 +4488,7 @@ void R_DrawModelShadows(void)
        vec3_t relativeshadowmins, relativeshadowmaxs;
        vec3_t tmp, shadowdir;
 
-       if (!r_refdef.scene.numentities || !vid.stencil || r_shadow_shadowmode != R_SHADOW_SHADOWMODE_STENCIL)
+       if (!r_refdef.scene.numentities || !vid.stencil || (r_shadow_shadowmode != R_SHADOW_SHADOWMODE_STENCIL && r_shadows.integer != 1))
                return;
 
        CHECKGLERROR