PDA

View Full Version : Multisample quality for screen not as good as for FBO on ATI Radeon



CRasterImage
09-17-2012, 10:44 AM
I am not sure if this is a card-specific thing, driver-specific or if I am doing something wrong.

Here is the problem:
The card (ATI Radeon HD 4300/4500 Series) does 4x multisampling. The quality of the output is lower when drawing to the screen
http://chattypics.com/files/screen_q1oju76nc2.png
than it is if you draw to a multisampled FBO
http://chattypics.com/files/fbo_e4amht2pnv.png


The problem doesn't appear on my other machine which has an NVidia card.
But then, that card does 16x multisampling and maybe the difference there. But just isn't noticeable.

Alfonse Reinheart
09-17-2012, 12:01 PM
How are you doing your "multisampled FBO"?

CRasterImage
09-17-2012, 12:50 PM
glGenFramebuffersEXT( 1, &m_DL_FBO );
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_DL_FBO);

//Now make a multisample color buffer
int samples = CDLOpenGLCaps::Instance()->Cap_int(DLOCT_MULTISAMPLE_SAMPLES);

glGenRenderbuffersEXT(1, &m_DL_FBO_color_buffer);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_DL_FBO_color_buffer);
glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFE R_EXT, samples, GL_RGBA8, m_FBO_width, m_FBO_height);

//----------------------
//Make a stencil buffer
//This is a combo depth+stencil buffer
//because it is the most widely supported way of doing things.
//even when you don't need, or use, the depth buffer.
glGenRenderbuffersEXT(1, &m_DL_FBO_stencil_buffer);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_DL_FBO_stencil_buffer);
glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFE R_EXT, samples, GL_DEPTH24_STENCIL8_EXT, m_FBO_width, m_FBO_height);


//It's time to attach the RBs to the FBO
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, m_DL_FBO_color_buffer);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_DL_FBO_stencil_buffer);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_DL_FBO_stencil_buffer);
//Make sure FBO status is good
CheckForFBOError();
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);