PDA

View Full Version : FBO and depth renderbuffer object



jide
01-20-2006, 10:25 AM
I can't attach any depth rbo to my fbo.

Here is what I've done:

create one rbo with depth storage, create one fbo attaching the rbo and also attaching some textures. I don't attach any color buffer (but also tried it). I tried to attach just one cubemap texture but also the 6 ones without success.

The FBO is only complete when I do not attach any depth rbo. Any hints on how to attach it ?

EDIT: Well, maybe that could help a bit as FBO seems sensitive to drivers and graphic cards: Linux, Geforce FX 5600, nvidia driver 7667 - didn't tried out 8xxx yet.

Madoc
01-20-2006, 01:02 PM
This ought to work:


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

glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, Tex, 0);

glGenRenderbuffersEXT(1, &RB);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, RB);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, width, height);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, RB);I think that's very similar to what's in the spec and probably not too different from what you have already. If that doesn't work... try updating drivers?

jide
01-21-2006, 09:15 AM
I got it to work and the rendering is even faster than without FBO on the lastest drivers (8174). It was about 147 fps before and now is about 180 fps !