Skip to content

Commit 883f9e5

Browse files
committed
Fix anti-aliasing on macOS
Blitting to the resolve FBO in OSG::RenderStage was causing a GL_INVALID_FRAMEBUFFER_OPERATION due to a mismatch in attached colorbuffers between the FBOs bound in read and draw slots. This was because the normal attachment was invariantly attached to FBO_Interrupt, but not to other FBOs.
1 parent 1f724cc commit 883f9e5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/openmw/mwrender/postprocessor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ namespace MWRender
503503
if (mSamples > 1)
504504
{
505505
fbos[FBO_Multisample] = new osg::FrameBufferObject;
506+
fbos[FBO_Intercept] = new osg::FrameBufferObject;
506507
auto colorRB = createFrameBufferAttachmentFromTemplate(
507508
Usage::RENDER_BUFFER, width, height, textures[Tex_Scene], mSamples);
508509
if (mNormals && mNormalsSupported)
@@ -511,6 +512,8 @@ namespace MWRender
511512
Usage::RENDER_BUFFER, width, height, textures[Tex_Normal], mSamples);
512513
fbos[FBO_Multisample]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER1, normalRB);
513514
fbos[FBO_FirstPerson]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER1, normalRB);
515+
fbos[FBO_Intercept]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER1,
516+
Stereo::createMultiviewCompatibleAttachment(textures[Tex_Normal]));
514517
}
515518
auto depthRB = createFrameBufferAttachmentFromTemplate(
516519
Usage::RENDER_BUFFER, width, height, textures[Tex_Depth], mSamples);
@@ -519,11 +522,8 @@ namespace MWRender
519522
osg::FrameBufferObject::BufferComponent::PACKED_DEPTH_STENCIL_BUFFER, depthRB);
520523
fbos[FBO_FirstPerson]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER0, colorRB);
521524

522-
fbos[FBO_Intercept] = new osg::FrameBufferObject;
523525
fbos[FBO_Intercept]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER0,
524526
Stereo::createMultiviewCompatibleAttachment(textures[Tex_Scene]));
525-
fbos[FBO_Intercept]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER1,
526-
Stereo::createMultiviewCompatibleAttachment(textures[Tex_Normal]));
527527
}
528528
else
529529
{

0 commit comments

Comments
 (0)