View Single Post
Old 12-11-06, 07:56 AM   #1
georg
Registered User
 
Join Date: Jun 2003
Posts: 24
Default Frame buffer object with RGBA+z doesn't work for me..

Hi,

am I doing something wrong? This is on a 7900 with 96.31 drivers; I'm trying to get an off-screen buffer with RGBA and Depth. The following results in
GL_FRAMEBUFFER_UNSUPPORTED_EXT. If I leave out the depth buffer bits and just use RGBA, it works just fine.... I thought nvidia said RGBA+Z was supported everywhere?

Code:
GLuint FrameTex;
glGenTextures(1, &FrameTex);
glBindTexture(GL_TEXTURE_RECTANGLE_ARB,FrameTex);
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 
             GL_RGBA, 640, 480, 0, 
             GL_RGBA, GL_UNSIGNED_BYTE, NULL); 
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

GLuint DepthBuffer;
glGenRenderbuffersEXT(1, &DepthBuffer);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthBuffer);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, 640, 480);

GLuint FrameBuffer;
glGenFramebuffersEXT(1, &FrameBuffer);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FrameBuffer); 
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, 
			    GL_TEXTURE_RECTANGLE_ARB, FrameTex, 0);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, 
  			       GL_RENDERBUFFER_EXT, DepthBuffer);
  

CheckFramebufferStatus();
georg is offline   Reply With Quote