From f6943f9f6683d3ceed105c21d93b18c4dd989e15 Mon Sep 17 00:00:00 2001 From: "glassmancody.info" Date: Mon, 6 Jun 2022 20:52:40 -0700 Subject: [PATCH] bind framebuffer when msaa enabled in transparent postpass --- apps/openmw/mwrender/transparentpass.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwrender/transparentpass.cpp b/apps/openmw/mwrender/transparentpass.cpp index 8bb5713230..e5368e7f3e 100644 --- a/apps/openmw/mwrender/transparentpass.cpp +++ b/apps/openmw/mwrender/transparentpass.cpp @@ -63,10 +63,7 @@ namespace MWRender ext->glBlitFramebuffer(0, 0, tex->getTextureWidth(), tex->getTextureHeight(), 0, 0, tex->getTextureWidth(), tex->getTextureHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); - if (msaaFbo) - msaaFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER); - else - fbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER); + msaaFbo ? msaaFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER) : fbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER); // draws scene into primary attachments bin->drawImplementation(renderInfo, previous); @@ -82,8 +79,7 @@ namespace MWRender bin->drawImplementation(renderInfo, previous); bin->setStateSet(restore); - if (!msaaFbo) - fbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER); + msaaFbo ? msaaFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER) : fbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER); } } \ No newline at end of file