diff --git a/gl_glare.c b/gl_glare.c index d672ff9..eb906e7 100644 --- a/gl_glare.c +++ b/gl_glare.c @@ -223,7 +223,7 @@ void R_Glare () // GL_Bind(glare_object); // glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 128, 128); - glClear (GL_DEPTH_BUFFER_BIT); + glClear (GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); r_refdef.vrect.x = ox; r_refdef.vrect.y = oy; @@ -309,4 +309,4 @@ glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glDisable (GL_BLEND); glEnable (GL_ALPHA_TEST); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); -} \ No newline at end of file +} diff --git a/gl_rmain.c b/gl_rmain.c index 58e4e8e..cd268ae 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -2104,7 +2104,7 @@ void R_RenderScene (void) //} if (!sh_noscissor.value) { - glClear(GL_STENCIL_BUFFER_BIT); +// glClear(GL_STENCIL_BUFFER_BIT); // already cleared R_ClearRectList(); } @@ -2488,7 +2488,7 @@ void R_Mirror (mirrorplane_t *mir) GL_Bind(mir->texture_object); glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256); - glClear (GL_DEPTH_BUFFER_BIT); + glClear (GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); if (mir_detail.value < 2) { @@ -2701,9 +2701,9 @@ void R_Clear (void) { if (gl_clear.value || gl_wireframe.value) - glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); else - glClear (GL_DEPTH_BUFFER_BIT); + glClear (GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); gldepthmin = 0; gldepthmax = 1; glDepthFunc (GL_LEQUAL);