mirror of https://github.com/ioquake/ioq3.git
#6059: OpenGL2: Read depths from resolve fbo when msaa is on in RB_TestFlare().
This commit is contained in:
parent
dadd808da5
commit
e686010d73
|
@ -277,6 +277,7 @@ void RB_TestFlare( flare_t *f ) {
|
||||||
qboolean visible;
|
qboolean visible;
|
||||||
float fade;
|
float fade;
|
||||||
float screenZ;
|
float screenZ;
|
||||||
|
FBO_t *oldFbo;
|
||||||
|
|
||||||
backEnd.pc.c_flareTests++;
|
backEnd.pc.c_flareTests++;
|
||||||
|
|
||||||
|
@ -284,9 +285,22 @@ void RB_TestFlare( flare_t *f ) {
|
||||||
// don't bother with another sync
|
// don't bother with another sync
|
||||||
glState.finishCalled = qfalse;
|
glState.finishCalled = qfalse;
|
||||||
|
|
||||||
|
// if we're doing multisample rendering, read from the correct FBO
|
||||||
|
oldFbo = glState.currentFBO;
|
||||||
|
if (tr.msaaResolveFbo)
|
||||||
|
{
|
||||||
|
FBO_Bind(tr.msaaResolveFbo);
|
||||||
|
}
|
||||||
|
|
||||||
// read back the z buffer contents
|
// read back the z buffer contents
|
||||||
qglReadPixels( f->windowX, f->windowY, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth );
|
qglReadPixels( f->windowX, f->windowY, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth );
|
||||||
|
|
||||||
|
// if we're doing multisample rendering, switch to the old FBO
|
||||||
|
if (tr.msaaResolveFbo)
|
||||||
|
{
|
||||||
|
FBO_Bind(oldFbo);
|
||||||
|
}
|
||||||
|
|
||||||
screenZ = backEnd.viewParms.projectionMatrix[14] /
|
screenZ = backEnd.viewParms.projectionMatrix[14] /
|
||||||
( ( 2*depth - 1 ) * backEnd.viewParms.projectionMatrix[11] - backEnd.viewParms.projectionMatrix[10] );
|
( ( 2*depth - 1 ) * backEnd.viewParms.projectionMatrix[11] - backEnd.viewParms.projectionMatrix[10] );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue