From: eihrul Date: Tue, 9 Mar 2010 02:51:39 +0000 (+0000) Subject: use stencil shadows if r_shadows == 1 X-Git-Tag: xonotic-v0.1.0preview~230^2~420 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d58035349558ffa4f33dff870841179624296c93;p=xonotic%2Fdarkplaces.git use stencil shadows if r_shadows == 1 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10049 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index 4dda5da6..160696f5 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -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(); diff --git a/r_shadow.c b/r_shadow.c index 9b1fbf83..33c3005f 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -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