mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-20 08:41:32 +00:00
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.
This commit is contained in:
parent
1f724cc336
commit
883f9e5049
1 changed files with 3 additions and 3 deletions
|
@ -503,6 +503,7 @@ namespace MWRender
|
|||
if (mSamples > 1)
|
||||
{
|
||||
fbos[FBO_Multisample] = new osg::FrameBufferObject;
|
||||
fbos[FBO_Intercept] = new osg::FrameBufferObject;
|
||||
auto colorRB = createFrameBufferAttachmentFromTemplate(
|
||||
Usage::RENDER_BUFFER, width, height, textures[Tex_Scene], mSamples);
|
||||
if (mNormals && mNormalsSupported)
|
||||
|
@ -511,6 +512,8 @@ namespace MWRender
|
|||
Usage::RENDER_BUFFER, width, height, textures[Tex_Normal], mSamples);
|
||||
fbos[FBO_Multisample]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER1, normalRB);
|
||||
fbos[FBO_FirstPerson]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER1, normalRB);
|
||||
fbos[FBO_Intercept]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER1,
|
||||
Stereo::createMultiviewCompatibleAttachment(textures[Tex_Normal]));
|
||||
}
|
||||
auto depthRB = createFrameBufferAttachmentFromTemplate(
|
||||
Usage::RENDER_BUFFER, width, height, textures[Tex_Depth], mSamples);
|
||||
|
@ -519,11 +522,8 @@ namespace MWRender
|
|||
osg::FrameBufferObject::BufferComponent::PACKED_DEPTH_STENCIL_BUFFER, depthRB);
|
||||
fbos[FBO_FirstPerson]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER0, colorRB);
|
||||
|
||||
fbos[FBO_Intercept] = new osg::FrameBufferObject;
|
||||
fbos[FBO_Intercept]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER0,
|
||||
Stereo::createMultiviewCompatibleAttachment(textures[Tex_Scene]));
|
||||
fbos[FBO_Intercept]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER1,
|
||||
Stereo::createMultiviewCompatibleAttachment(textures[Tex_Normal]));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue