Clear stencil with depth buffer

This commit is contained in:
jpaana 2003-08-20 20:24:22 +00:00
parent a570f0e972
commit f6b6214605
2 changed files with 6 additions and 6 deletions

View file

@ -223,7 +223,7 @@ void R_Glare ()
// GL_Bind(glare_object); // GL_Bind(glare_object);
// glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 128, 128); // 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.x = ox;
r_refdef.vrect.y = oy; r_refdef.vrect.y = oy;

View file

@ -2104,7 +2104,7 @@ void R_RenderScene (void)
//} //}
if (!sh_noscissor.value) { if (!sh_noscissor.value) {
glClear(GL_STENCIL_BUFFER_BIT); // glClear(GL_STENCIL_BUFFER_BIT); // already cleared
R_ClearRectList(); R_ClearRectList();
} }
@ -2488,7 +2488,7 @@ void R_Mirror (mirrorplane_t *mir)
GL_Bind(mir->texture_object); GL_Bind(mir->texture_object);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256); 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) { if (mir_detail.value < 2) {
@ -2701,9 +2701,9 @@ void R_Clear (void)
{ {
if (gl_clear.value || gl_wireframe.value) 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 else
glClear (GL_DEPTH_BUFFER_BIT); glClear (GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
gldepthmin = 0; gldepthmin = 0;
gldepthmax = 1; gldepthmax = 1;
glDepthFunc (GL_LEQUAL); glDepthFunc (GL_LEQUAL);