From: havoc Date: Sat, 7 Apr 2007 08:09:47 +0000 (+0000) Subject: added clearstencil parameter to R_Shadow_RenderMode_StencilShadowVolumes X-Git-Tag: xonotic-v0.1.0preview~3352 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;ds=sidebyside;h=018792046effbf5f5743d6ef9569f6c3a2480ae9;p=xonotic%2Fdarkplaces.git added clearstencil parameter to R_Shadow_RenderMode_StencilShadowVolumes git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7069 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/r_shadow.c b/r_shadow.c index 0959b37b..61c23ec1 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -1062,7 +1062,7 @@ void R_Shadow_RenderMode_Reset(void) GL_BlendFunc(GL_ONE, GL_ZERO); } -void R_Shadow_RenderMode_StencilShadowVolumes(void) +void R_Shadow_RenderMode_StencilShadowVolumes(qboolean clearstencil) { CHECKGLERROR R_Shadow_RenderMode_Reset(); @@ -1088,7 +1088,8 @@ void R_Shadow_RenderMode_StencilShadowVolumes(void) qglStencilMask(~0);CHECKGLERROR qglStencilOp(GL_KEEP, GL_DECR, GL_KEEP);CHECKGLERROR } - GL_Clear(GL_STENCIL_BUFFER_BIT); + if (clearstencil) + GL_Clear(GL_STENCIL_BUFFER_BIT); r_refdef.stats.lights_clears++; } @@ -2918,7 +2919,7 @@ void R_DrawRTLight(rtlight_t *rtlight, qboolean visible) if (gl_stencil) { usestencil = true; - R_Shadow_RenderMode_StencilShadowVolumes(); + R_Shadow_RenderMode_StencilShadowVolumes(true); if (numsurfaces) R_Shadow_DrawWorldShadow(numsurfaces, surfacelist, shadowtrispvs); for (i = 0;i < numshadowentities;i++) @@ -3018,7 +3019,7 @@ void R_DrawModelShadows(void) else r_shadow_shadowingrendermode = R_SHADOW_RENDERMODE_STENCIL; - R_Shadow_RenderMode_StencilShadowVolumes(); + R_Shadow_RenderMode_StencilShadowVolumes(true); for (i = 0;i < r_refdef.numentities;i++) { diff --git a/r_shadow.h b/r_shadow.h index 963dc5d5..724a7917 100644 --- a/r_shadow.h +++ b/r_shadow.h @@ -44,7 +44,7 @@ void R_Shadow_RenderLighting(int firstvertex, int numvertices, int numtriangles, void R_Shadow_RenderMode_Begin(void); void R_Shadow_RenderMode_ActiveLight(rtlight_t *rtlight); void R_Shadow_RenderMode_Reset(void); -void R_Shadow_RenderMode_StencilShadowVolumes(void); +void R_Shadow_RenderMode_StencilShadowVolumes(qboolean clearstencil); void R_Shadow_RenderMode_Lighting(qboolean stenciltest, qboolean transparent); void R_Shadow_RenderMode_VisibleShadowVolumes(void); void R_Shadow_RenderMode_VisibleLighting(qboolean stenciltest, qboolean transparent);