framebuffer object with multisample

Hi,

I have trouble with attaching a multisampled render buffer to a fbo. The error message is GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT. Here is the code:

 
  glGenFramebuffersEXT(1, &fbo_id);
  glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo_id);

  glGenRenderbuffersEXT(1, &ren_id);
  glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, ren_id);
  glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, 1, GL_RGBA, fbo_width, fbo_height);
  glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT2_EXT, GL_RENDERBUFFER_EXT, ren_id)glGenFramebuffersEXT(1, &fbo_id);
  GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);

If I set the render buffer without multisample, it works well.

My graphics card is Radeon 9700 pro.
GLee tells me that GL_EXT_framebuffer_multisample and GL_EXT_framebuffer_blit are supported. The render buffer size is 1024x1024. What else could be the problem?

why are you using ATTACHMENT2? Won’t it be ATTACHMENT0?

sorry, it should be

glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, ren_id)glGenFramebuffersEXT(1, &fbo_id);

Originally the framebuffer has one render buffer and two texture attached to it. To narrow down the source of error, I comment out two textures, and keep only the render buffer.

GL_COLOR_ATTAEHMENT3_EXT is just one of the parameters that I tried to make it work.
Even I changed the argument to GL_COLOR_ATTAEHMENT3_EXT or GL_DEPTH_ATTACHMENT_EXT, the error is still there.

ive no problems setting multisamples with FBO (with nvidia though havent tested AMD)

>>glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT2_EXT, GL_RENDERBUFFER_EXT, ren_id)glGenFramebuffersEXT(1, &fbo_id);

whats glGenFramebuffersEXT(1, &fbo_id) doing at the end of the line, also 1 samples == no AA (i think, this maybe wrong)
also as zengar saiz GL_COLOR_ATTACHMENT2_EXT looks a bit dubious try GL_COLOR_ATTACHMENT0_EXT

apart from that i cant see anything obvious, i dont see where youre setting up the depth renderbuffer though

hi zed,

Sorry about the typo of copy paste.
“glGenFramebuffersEXT(1, &fbo_id);” is not in my code. And I mean I tried GL_COLOR_ATTACHMENT0_EXT instead of ATTACHMENT2 or ATTACHMENT3. I also tried GL_DEPTH_ATTACHMENT.

Since it works fine without multisample, my suspicious is 9700 does not support it. It does not work on 9800 either. Unfortunately, I don’t have any newer ATI or Nvidia cards to test.

ps. I update to the latest driver, 8.411.0.0, on my 9800, then suddenly all the opengl programs crashed. So I have to roll the driver back to a previous one.

None of the older ATI drivers support the framebuffer_multisample extension, though the brand new ones might. NVIDIA supports it on Linux at least as far back as the 6600, maybe further. I haven’t checked on Windows.

thanks for the information!

May I ask where to check this kind of information?
The weird thing is, in GLee, the extensions check are all okay, but in fact ati doesn’t support them.

I am tired of guessing each time whether the error is from my code or the non-supported video card.

For ATI, checkout this (A bit deprecated unfortunately)

For NVIDIA, here .

thanks Y-tension!

In ATI’s extension list, I cannot find any information about neither EXT_framebuffer_object nor EXT_framebuffer_multisample. But 9700 does support framebuffer_object. So the doc is deprecated just as you said.

The NVIDIA’s list caught my attention. I found framebuffer_object, framebuffer_blit, and framebuffer_multisample are all supported in NV3x, NV4x, G8x, which represent Nvidia 5xxx, 6xxx, and 8xxx series respectively. So I guess 7xxx series all also support those extensions.

Man, that’s a huge difference! I definitely want to get a NV card next time. And I learned that there is a reason to buy a low end card in high series, such as 8400 GS, if somebody just wants to get more programmability support.

So I guess 7xxx series all also support those extensions.
The 7000 series is also powered by an NV4x chip.