Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / 3D Theory & Graphics / FBO & single depth texture attachment Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
fahlen

May 20, 2005, 05:47 AM

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:

  1.  
  2. glGenFramebuffersEXT(1, &fb);
  3. glGenTextures(1, &texture);
  4. glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
  5.  
  6. glBindTexture(GL_TEXTURE_2D, texture);
  7. glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, 1024, 1024, 0, GL_DEPTH_COMPONENT, GL_INT, NULL);
  8. glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, texture, 0);
  9.  
  10. checkFramebufferStatus();
  11.  


Does anyone have any idea as to what I may be doing wrong? Any help would be greatly appreciated.

/Markus

 
kbray

May 20, 2005, 03:08 PM



fahlen wrote: 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:
  1.  
  2. glGenFramebuffersEXT(1, &fb);
  3. glGenTextures(1, &texture);
  4. glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
  5.  
  6. glBindTexture(GL_TEXTURE_2D, texture);
  7. glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, 1024, 1024, 0, GL_DEPTH_COMPONENT, GL_INT, NULL);
  8. glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, texture, 0);
  9.  
  10. checkFramebufferStatus();
  11.  
Does anyone have any idea as to what I may be doing wrong? Any help would be greatly appreciated. /Markus


That pretty much looks right. However, you may want to specify the filtering mode before you call glTexImage (nearest is your only option for depth textures IIRC). Also, render to depth texture may not be supported in the current driver set, but I'm not sure on that one.

Kevin

 
This thread contains 2 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.