Hi,
I’m working with a GeForce 6800 GT card and the installed drivers are Forceware 76.44. I’m having a problem using an FBO with a single depth texture attached. It gives me the error GL_FRAMEBUFFER_UNSUPPORTED_EXT. To initialize the FBO, I use the code below:
One idea would be that you have not set the minification filter to not use mipmaps (default is GL_LINEAR_MIPMAP_NEAREST) and the texture is inconsistent.
(7) Render to depth texture with no color attachments
// Given: depth_tex - TEXTURE_2D depth texture object
// fb - framebuffer object
// Enable render-to-texture
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
// Set up depth_tex for render-to-texture
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
GL_DEPTH_ATTACHMENT_EXT,
GL_TEXTURE_2D, depth_tex, 0);
// No color buffer to draw to or read from
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);
CHECK_FRAMEBUFFER_STATUS();
<draw something>
// Re-enable rendering to the window
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindTexture(GL_TEXTURE_2D, depth_tex);
<draw to the window, reading from the depth_tex>
Looks like you’re missing the glDrawBuffer and glReadBuffer calls.
For clarity I would separate the texture initialization and FBO settings in your code.
Thanks again for your reply. I’ve tried to insert glDrawBuffer(GL_NONE) and glReadBuffer(GL_NONE) as in the example from the specification, but still no luck. I’m starting to question whether or not it’s my beta drivers (76.44) that aren’t behaving well… but then again, it’s probably more likely that I’m the one doing something wrong
I’ve upgraded to Forceware 76.45 drivers and tried to unbind the texture before attaching it to the framebuffer object, but glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) still gives me GL_FRAMEBUFFER_UNSUPPORTED_EXT.
I’m dying to find out what I’m doing wrong… especially since it was so easy to set up an FBO with 3 renderbuffers and use them as MRTs. Somehow I though setting up an FBO with a single depth texture for shadow mapping would be easier.
Are you already shure that the depthmap generated is valid? I had the same problem and did the following different:
-i have another dummy color texture created and attached to the FBO
-i don’t have a color renderbuffer like you, but a depth renderbuffer
-calling glDraw/ReadBuffer with GL_NONE won’t work
-> No error, but I don’t know wether it will work as it should (shadow mapping isn’t working, but it could be another mistake too in the shader or so…)
So if your method works, I would prefer it (no dummy texture creation)
But I thought there has to be an attached depth buffer? Can there be a depth test if no depth renderbuffer is bound? This is important for me because there might be more objects behind each other and the depth of the nearest is important…
To Zengar,
I would install the 76.91 drivers if I had access to them Being a registered developer with nVIDIA isn’t a privilege granted to anyone… and I’m just doing a master thesis, so my chances of being accepted are slim to say the least…