NVIDIA Forceware 75.90 => OpenGL 2.0.0 & fbo

So you are saying this code gives you a working texture when binding it as an active texture and using it for rendering objects? It will simple not show up for me…ahhhh must be doing something wrong here.

Originally posted by yooyo:
[b]I write this and it works…

  
  glGenTextures(1, &color_tex);
  glBindTexture(GL_TEXTURE_2D, color_tex));
  glTexParameteri( GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE );
  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, TEXX, TEXY, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture_data);
  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, color_tex, 0);

yooyo[/b]

Someone said that without all mipmaps in texture and linear_mipmap_linear filter fbo returns unsupported. So I try to generate all mipmaps before glFramebufferTexture2DEXT call and fbo accept it :slight_smile:

After rendering in fbo bind texture as usual and call glGenerateMipmapEXT(GL_TEXTURE_2D). This call should build all mipmaps.

Trick is to use:

  
  glGenTextures(1, &color_tex);
  glBindTexture(GL_TEXTURE_2D, color_tex);
  glTexParameteri( GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE ); // force driver to build mipmaps
  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, TEXX, TEXY, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture_data);
  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, color_tex, 0);

or

  
  glGenTextures(1, &color_tex);
  glBindTexture(GL_TEXTURE_2D, color_tex);
  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, TEXX, TEXY, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture_data);
  glGenerateMipmapEXT(GL_TEXTURE_2D); // build mipmaps
  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, color_tex, 0);

yooyo

About the depth buffer, I had the UNSUPPORTED problem, too, until I changed GL_DEPTH_COMPONENT to GL_DEPTH_COMPONENT24… It seems the general format specifier doesn’t work…

Another question: I initialize my textures with glTexImage2D(…, NULL), similar to allocating a buffer object, and it works correctly. Is this supposed to work? That is, can I rely upon it working in other drivers (ATI, …)? Or do I have to allocate a dummy buffer?

I didn’t find anything in the spec, but perhaps I’m just missing something…

Originally posted by Overmind:
[b]Another question: I initialize my textures with glTexImage2D(…, NULL), similar to allocating a buffer object, and it works correctly. Is this supposed to work? That is, can I rely upon it working in other drivers (ATI, …)? Or do I have to allocate a dummy buffer?

I didn’t find anything in the spec, but perhaps I’m just missing something…[/b]
From 1.5 spec:
If the data argument of TexImage1D, TexImage2D, or TexImage3D is a null pointer (a zero-valued pointer in the C implementation), a one-, two-, or threed- dimensional texture array is created with the specified target, level, internalformat, width, height, and depth, but with unspecified image contents. In this case no pixel values are accessed in client memory, and no pixel processing is performed. Errors are generated, however, exactly as though the data pointer were valid.

I use the GLEW and GLUT for initializing OGL, and still have the problem. I changed GL_DEPTH_COMPONENT to GL_DEPTH_COMPONENT24 but it still doesnt work. Could someone posts a example of creating framebuffer object for rendering to texture with depth buffer?

The following works on my GF4 Ti 4200. I does not report a FRAMEBUFFER_UNSUPPORTED error.

For the rendering i used a window with a resolution of 640x480. The framebuffer object is 512x512, so i had to adjust the Viewport before rendering to the framebuffer object.
At the end I draw a screen sized quad using the rendered texture. The result does not look as it should! It seems as if only the blue color components are actually rendered into the texture!

When executing this i had enabled GL emulation via the nvemulate tool. After installing the Forceware 75.90 drivers I cannot disable emulation anymore! Does anyone know how to disable emulation manually?

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

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);	
glBindTexture(GL_TEXTURE_2D, color_tex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, 512, 512, 0, GL_RGB, GL_INT, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, color_tex, 0);
	
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);
	
CHECK_FRAMEBUFFER_STATUS();
	
glBindTexture(GL_TEXTURE_2D, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
	
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glViewport(0,0,512,512);
	
glBegin(GL_TRIANGLES);
  glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-0.5f, -0.5f);
  glColor3f(0.0f, 1.0f, 0.0f); glVertex2f( 0.5f, -0.5f);
  glColor3f(0.0f, 0.0f, 1.0f); glVertex2f( 0.0f,  0.5f);
glEnd();
	
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindTexture(GL_TEXTURE_2D, color_tex);
glEnable(GL_TEXTURE_2D);
glViewport(0,0,640,480);
	
//draw with texture
	
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
	
gluOrtho2D(0.0, 1.0, 0.0, 1.0);
	
glBegin(GL_QUADS);
  glTexCoord2f(0.0f, 0.0f); glVertex2f(0.0f, 0.0f);
  glTexCoord2f(1.0f, 0.0f); glVertex2f(1.0f, 0.0f);
  glTexCoord2f(1.0f, 1.0f); glVertex2f(1.0f, 1.0f);
  glTexCoord2f(0.0f, 1.0f); glVertex2f(0.0f, 1.0f);
glEnd(); 

Originally posted by Trenki:
It seems as if only the blue color components are actually rendered into the texture!

Try adding a glColor4f(1,1,1,1) before you draw the final quad maybe? :slight_smile:

Though I did notice similar symptoms (red channel not always rendering) when I forgot to unbind the texture to which I was rendering…

thanks for replies, but i have still the problem :slight_smile: . I think I do something wrong but i dont know what. So I plead very much all people here could someone post whole application?

Originally posted by B3:
Try adding a glColor4f(1,1,1,1) before you draw the final quad maybe?

This was it! How stupid from me :rolleyes:

As for whole application request: The code from my previous post is the whole OpenGL code of the application.
For initialisation i use SDL. The CHECK_FRAMEBUFFER_STATUS() macro is from the extension spec.

http://omega.fragless.org/demos/rtt-test.tar.gz

It’s a little demo that renders a few reflecting spheres… Nothing special, and the code is horribly unstructured. It is really just a test for a crossplatform build, so don’t expect too much.

I included Linux and Windows binaries. If you want to build it yourself, you need Jam (ftp://ftp.perforce.com/jam/).

You have to launch the application from the top level source directory, not from the binary directory, otherwise the texture is not found (and it will propably crash, I was too lazy to write error detection code :rolleyes: ).

thank you very much for demo. I tried it and I was very surprised when i get the unsuported error again. So I think that error is in my forceware instalation(I downloaded the forceare from guru3d). As I said I have GeForce FX5900. Could anyone explain this fu… error?

wow. I just find the error finaly :slight_smile: . I have set the DOOM3 profile in profiles and i get this error, so be careful in settings the profile in Settings view.

I just installed these drivers and i dunno if i’m the only one with this problem, but it seems vesa is no longer supported… (or is it not supported by default on geforce6800gt?) .

regards,

Has someone already succeeded in creating a stencil render buffer? For me, creating one as follows

  
glGenRenderbuffersEXT(1, &stencilID); 
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, stencilID);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX8_EXT, 512, 512);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, stencilID);

gives a framebuffer complete result, but the number of bitplanes returned by glGetIntegerv(GL_STENCIL_BITS, …) is zero nonetheless.

For me the above code gives an “invalid enumerant” error for the lines with glRenderbufferStorageEXT and glFramebufferRenderbufferEXT.

Apparently the driver does not yet understand the GL_STENCIL_INDEX8_EXT and the GL_STENCIL_ATTACHMENT_EXT enumerants.

Does anyone know what effect the use of GL_STENCIL_INDEX_EXT (without bitcount indication) should have?
The spec tells glRenderbufferStorageEXT can take it in the internalformat parameter, but it looses no word about what effect it should have. It isn’t even listed in the table 2.nnn!

I used a GF4 Ti 4200 (i had emulation enabled; does anyone know how to disable it manually? nvemulate will not do it any more with the forceware 75.90 drivers on my system).

I cant seem to get FBO support either… Using 75.90 in 2k, on a 6800GT.

EDIT
It’s working now. I switched from dualview to single display. Still not available. Then just re-installed the drivers again, and the extension appeared. Working fine in dualview again.

i tried to make the error one more time but it isnt caused with doom3 profile but with something setting in settings panel. I am trieng to find the setting but i amnot succesful. It is certain a driver bug.

Found the problem. FBO doesn’t work in Multi-device compatibility mode or Multi-device performance mode. Only Single-display mode. :frowning:

I tried to set multidisplay and it works :slight_smile: . I think the implementation in this extension is fully of bugs, but its understandable, because its the first imlementation with this extension(or isnt it?).

I only skimmed the replies, so the question about a depth-only FBO may have been answered. In order to use an FBO without a color buffer bound, you much set the draw buffer (by calling glDrawBuffer or glDrawBuffers) to GL_NONE.

This is implied by the spec language. We have already recognized that we need to make it more explicit.