From d58035349558ffa4f33dff870841179624296c93 Mon Sep 17 00:00:00 2001 From: eihrul Date: Tue, 9 Mar 2010 02:51:39 +0000 Subject: [PATCH] use stencil shadows if r_shadows == 1 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10049 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_rmain.c | 6 +++--- r_shadow.c | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) 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 -- 2.39.2