Yet another FBO question

Hardware: GFX 5900 XT
Driver: 77.72 w/ FBO support

Ok, the problem is that i am using FBO for a certain dynamic texture. As far as the color part of the RT goes, it gets rendered fine in GL_COLOR_ATTACHMENT0_EXT. However, since i need z-buffering also therefore i create a “render buffer” with depth component 24 (or 16, doesn’t matter). But when i try to attach this render buffer to the FBO i get an error suggesting that the format is unsupported! However, if i use a depth texture (GL_DEPTH_COMPONENT) as a z-buffer and attach it to the FBO, everything works fine and i get proper depth buffering.

I would also like to know whether i can use the default depth buffer instead of creating one with each FBO that requires depth buffering?

Thanks in advance.

glGenRenderbuffers(1, &rb_dcm);
glBindRenderbuffer(GL_RENDERBUFFER_EXT, rb_dcm);
glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, dyn_cm_size, dyn_cm_size);
glBindRenderbuffer(GL_RENDERBUFFER_EXT, 0);

glGenFramebuffers(1, &fb_dcm);
glBindFramebuffer(GL_FRAMEBUFFER_EXT, 0);
  • some texture setup…

Thats exactly what i am doing! But when i try to attach the depth render buffer with the FBO it gives me an unsupported error report!

Any comments on using the “default” depth buffer in case you don’t want to create a seperate one (or share) for each FBO?

Dunno, my program works just fine (FW77.72), and it does depth renderbuffer sharing too…

Do you bind texture to color buffer? I didn’t included snippet for that…

Yes i do, and i have even matched my code with the FBO presentation on nVidia’s website and everything seems to be in order.

Btw, i think that binding a depth render buffer is irrelavent to binding a color texture target with FBO, since you could be doing depth only rendering too e.g. shadow maps. Any idea when ATI plans on making their OpenGL drivers upto date and less buggy, in case they haven’t totally dumped opengl altogether :slight_smile: . nVidia is very aggressive in providing latest extension support in their driver and ATI is really ignoring the OpenGL community (thats just my feeling). Its time they put their act together!

Thanks for the help though.

Search this forum, there was a FBO demo using depth and color buffers, working example might help you better.