NVIDIA Forceware 75.90 => OpenGL 2.0.0 & fbo

I’ve installed the beta driver version 76.41 and framebuffer objects don’t work anymore. Even the following example from the extension spec returns GL_FRAMEBUFFER_UNSUPPORTED_EXT. How can I solve this problem? Thanks.

  
 glGenFramebuffersEXT(1, &fb);
        glGenTextures(1, &color_tex);
        glGenRenderbuffersEXT(1, &depth_rb);
        glGenRenderbuffersEXT(1, &stencil_rb);

        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);

        // initialize color texture
        glBindTexture(GL_TEXTURE_2D, color_tex);
        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, 512, 512, 0,
                     GL_RGB, GL_INT, NULL);
        glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
                                  GL_COLOR_ATTACHMENT0_EXT,
                                  GL_TEXTURE_2D, color_tex, 0);

        // initialize depth renderbuffer
        glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depth_rb);
        glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,
                                 GL_DEPTH_COMPONENT24, 512, 512);
        glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
                                     GL_DEPTH_ATTACHMENT_EXT,
                                     GL_RENDERBUFFER_EXT, depth_rb);

        // initialize stencil renderbuffer
        glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, stencil_rb);
        glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,
                                 GL_STENCIL_INDEX, 512, 512);
        glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
                                     GL_STENCIL_ATTACHMENT_EXT,
                                     GL_RENDERBUFFER_EXT, stencil_rb);

forget about stencil at this time, it isnt functional, and it seems to be the hiden bug, which I had too. Try to reinstall driver, set another profile in settings and the settings too.

Thanks. It works now. I removed the stencil renderbuffer, and changed some random settings in the control panel.

I’ve implemented multiple color buffers for multiple outputs from fragment shaders. It works however strange things are happening, the images appear to blend together. That is, faces that are occulded are still visible, objects appear to be “see through”. I’ve tried playing around with glCullFace and normal directions but to no avail. This only seems to happen when using multiple color buffers. Anyone have any ideas? Here’s an image to demonstrate: Sample Image

I should have noted that in the sample image, the problem is that you can see the handle of the teapot, “through” the teapot.

Originally posted by potmat:
I’ve implemented multiple color buffers for multiple outputs from fragment shaders. It works however strange things are happening, the images appear to blend together. That is, faces that are occulded are still visible, objects appear to be “see through”. I’ve tried playing around with glCullFace and normal directions but to no avail. This only seems to happen when using multiple color buffers. Anyone have any ideas? Here’s an image to demonstrate: Sample Image
Probably no depth test enabled?

Problem solved. The depth test WAS enabled, but it lacked this line

glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depth_rb);  

I put together a demo that uses FBOs, however I didn’t really notice neither a gain nor a loss in performance after switching from Pixel Buffers…
hmmm
Screenshot
Binaries
Source
Engine source

Nice Demo, but I can see why it wouldn’t show much of a difference in performance. Correct me if I’m wrong, but I’d imagine that the effect your doing only requires 2 or 3 rtt operations per frame, right? That would mean 3 or 4 context switches with the pbuffering system. While I’m sure there is SOME slowdown there, when it’s on that small of a scale it probably won’t even make a blip on modern hardware, so the switch to FBO would probably seem negligable.

The real improvments are going to show up when we start using rtt as an integral part of our scenes. For example, in his latest Quakecon keynotes, Carmack mentioned that he was using shadow buffers in his research engine. Since FBO wasn’t avalible at that point, he was using pBuffers for all render to texture operations, which required “Hundreds of context switches per frame”, something he remarked was slowing down rendering significantly. I would imagine that in a situation like that the switch to FBO’s (if well implemented) would give a significant increase in speed.

Just my $0.02

I’m updating the dynamic cubemap about 30 times a second which corresponds to half the amount of context switches when using PBuffers.
With FBOs, I was expecting a slightly better behavior of the frame rate, but it was about the same.
I guess I’m shader limited in this case.
PS: notice when the bump scale is pushed all the way up, the frame rate falls dramatically. I’m lead to believe this is due to the way texture caches work since when normals change significally from one fragment to the other, cache data locality gets disturbed which results in intense flushing and buffering…slighlty off topic I know :stuck_out_tongue:

ok, i’ve been fighting these render buffers for a long time. here’s the problem…the fbo check status returns complete, i try to render and get nothing, however if i do a glClear with whatever color it will show up on the texture, but no matter what i seem to do no actual drawing will show. btw, if i draw the screen where i would be drawing to the fbo, it works fine. any ideas?

Originally posted by weesel:
…
if i draw the screen where i would be drawing to the fbo, it works fine. any ideas?
Note: I haven’t read up on FBO, why I don’t know if any of the following makes sense.

About the only thing I can come to think of, would be if buffers such as depth or alpha could be set separately for FBO’s vs. frame buffer. It should be easy enough to verify by turning off depth, alpha and stencil testing.

not sure what the problem was before, but i dropped the code i was using into what i was writing it for and it work, so alls well that ends well…almost that is. i am getting a different problem now, when i render to the fbo, it seems that part of it is getting cut off. the top and right sides of the texture are not getting drawn to. i am using the same size view ports. ???

At the moment I’m experimenting with shadow maps and FBO, it works Ok but if I have to attach a dummy color buffer to my frame buffer object otherwise its status is incomplete.

From the spec it seems unnecessary to do that (issue 45), so is this a limitation of the current drivers (76.43) or is this my fault ?

Maybe you forgot to set read and drawbuffer to GL_NONE?

Originally posted by skynet:
Maybe you forgot to set read and drawbuffer to GL_NONE?
In fact if I don’t set the draw buffer to GL_NONE the status is GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT, and the same with the read buffer (GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT)

If I set them both to GL_NONE the status becomes GL_FRAMEBUFFER_UNSUPPORTED_EXT

I tried the example below and I get the status UNSUPPORTED.

It work without depth buffer.

What is wrong with the depth buffer?

// create FBO
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
// create color texture	& attach to FBO
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, TEXX, TEXY, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glGenerateMipmapEXT(GL_TEXTURE_2D);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, tex, 0);
// initialize depth renderbuffer
glGenRenderbuffersEXT(1, &depth_rb);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depth_rb);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, TEXX, TEXY);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depth_rb);
// create depth texture & attach to FBO

glGenTextures(1, &depth_tex);
glBindTexture(GL_TEXTURE_2D, depth_tex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, TEXX, TEXY, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, depth_tex, 0);

my drivers are 76.45 and my card is gf6800gt