Hi there,
I am writing a code to resolve automatically the multisampling from one FBO (with multiple color attachements - MS textures) to another FBO (with the same color attachements - simple textures).
When applying this method to blit from one simple FBO to another (with same color attachements) it works perfectly well !
But when I just change the source FBO to a multisampled one (with multisampled textures), blitting is not resolved (but no error is detected using glGetError after the glBlitFramebuffer function).
Does anyone have any idea ?
I activated the “GL_MULTISAMPLE” state and my multisampled FBO / textures have 4 samples too.
(I set my window with 1 sample buffer with 4 samples (but it should not have any incidence while blitting)
void resolve()
{
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fboSrcID);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_fboDstID);
// there are 2 color attachements (textures)
for(unsigned int i = 0 ; i < 2; i++)
{
glReadBuffer(GL_COLOR_ATTACHMENT0+i);
glDrawBuffer(GL_COLOR_ATTACHMENT0+i);
glBlitFramebuffer(0,0,1024,1024,0,0,1024,1024,GL_COLOR_BUFFER_BIT, GL_NEAREST);
GLenum err = glGetError();
if(err!=GL_NO_ERROR)
{
printf("Error while blitting\n");
}
}
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}