Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualic0de

Posted 22 November 2012 - 10:50 PM

I hate answering my own questions but I'll put this here in case anyone needs it. I came up with an ugly solution that involves doing two blits changing glDrawBuffer in between.

glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fbo0);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fbo1);
glBlitFramebufferEXT(0, 0, screenw, screenh, 0, 0, screenw, screenh, GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT, GL_NEAREST);
glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT);
glBlitFramebufferEXT(0, 0, screenw, screenh, 0, 0, screenw, screenh, GL_COLOR_BUFFER_BIT, GL_NEAREST);

#1ic0de

Posted 22 November 2012 - 10:48 PM

I hate answering my own questions but I'll put this here in case anyone needs it. I came up with an ugly solution that involves doing two blits changing glDrawBuffer in between.

glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
  glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
  glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, msbuffer.fbo);
  glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fbo1.fbo);
  glBlitFramebufferEXT(0, 0, msbuffer.screenw, msbuffer.screenh, 0, 0, fbo1.screenw, fbo1.screenh, GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT, GL_NEAREST);
  glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
  glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT);
  glBlitFramebufferEXT(0, 0, msbuffer.screenw, msbuffer.screenh, 0, 0, fbo1.screenw, fbo1.screenh, GL_COLOR_BUFFER_BIT, GL_NEAREST);

PARTNERS