GL_BlendFunc(GL_ONE, GL_ZERO);
}
-void R_Shadow_RenderMode_StencilShadowVolumes(void)
+void R_Shadow_RenderMode_StencilShadowVolumes(qboolean clearstencil)
{
CHECKGLERROR
R_Shadow_RenderMode_Reset();
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++;
}
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++)
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++)
{
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);