Skip to content

Commit 55fd784

Browse files
committed
[rend2] Only clear backbuffer depth
Apparently additionally copying depth to the backbuffer is super slow on older graphics cards. Unfortunately this disables depth rejection for refraction surfaces. Need a better system for those anyways. So, just go for it for now.
1 parent 616ade6 commit 55fd784

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

shared/rd-rend2/tr_backend.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3223,8 +3223,8 @@ const void *RB_PostProcess(const void *data)
32233223
FBO_FastBlitFromTexture(srcFbo->colorImage[0], NULL, dstBox, color, 0);
32243224
}
32253225

3226-
// Copy depth buffer to the backbuffer for depth culling refractive surfaces
3227-
FBO_FastBlit(tr.renderFbo, srcBox, NULL, dstBox, GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, GL_NEAREST);
3226+
// Copy depth buffer to the backbuffer for depth culling refractive surfaces, or don't. It's slow
3227+
//FBO_FastBlit(srcFbo, srcBox, NULL, dstBox, GL_DEPTH_BUFFER_BIT, GL_NEAREST);
32283228
}
32293229

32303230
if (r_drawSunRays->integer)
@@ -3305,6 +3305,8 @@ const void *RB_PostProcess(const void *data)
33053305
backEnd.refdef.drawSurfs + backEnd.refdef.fistDrawSurf,
33063306
backEnd.refdef.numDrawSurfs - tr.refdef.fistDrawSurf);
33073307
backEnd.refractionFill = qfalse;
3308+
GL_State(GLS_DEFAULT);
3309+
glClear(GL_DEPTH_BUFFER_BIT);
33083310

33093311
return (const void *)(cmd + 1);
33103312
}

0 commit comments

Comments
 (0)