PDA

View Full Version : EXT_PACKED_DEPTH_STENCIL FBO problems



Starfox
10-19-2005, 03:52 PM
I'm trying to make an FBO with a depth/stencil texture, on an nVidia GeForce Go 6600 using the 81.84 beta drivers. I keep getting an INVALID_FRAMEBUFFER_OPERATION_EXT when calling glClear(), glEnd(), etc.

code:


glGenFramebuffersEXT(1, &FrameBufferObject);
glGenTextures(1, &FrameTexture);
glGenTextures(1, &DepthStencilRT);

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FrameBufferObject);

///////////
glBindTexture(GL_TEXTURE_2D, FrameTexture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8,
512, 512, 0, GL_RGBA, GL_INT, NULL);
glGenerateMipmapEXT(GL_TEXTURE_2D);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, FrameTexture, 0);

// Setup depth_stencil texture (not mipmap)
glBindTexture(GL_TEXTURE_2D, DepthStencilRT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8_EXT,
512, 512, 0, GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, NULL);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
GL_DEPTH_ATTACHMENT_EXT,
GL_TEXTURE_2D, DepthStencilRT, 0);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
GL_STENCIL_ATTACHMENT_EXT,
GL_TEXTURE_2D, DepthStencilRT, 0);
///////////////
CheckFramebufferStatus(); Any ideas?
TIA

ebray99
10-21-2005, 01:04 PM
You need to set your texture filtering modes for your color texture.

- Kevin

Starfox
10-21-2005, 03:34 PM
now the code is


glGenFramebuffersEXT(1, &FrameBufferObject);
glGenTextures(1, &FrameTexture);
glGenTextures(1, &DepthStencilRT);
//glGenRenderbuffersEXT(1, &DepthStencilRT);

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FrameBufferObject);

///////////
glBindTexture(GL_TEXTURE_2D, FrameTexture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8,
Width, Height, 0, GL_RGBA, GL_INT, NULL);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glGenerateMipmapEXT(GL_TEXTURE_2D);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, FrameTexture, 0);

// Setup depth_stencil texture (not mipmap)
glBindTexture(GL_TEXTURE_2D, DepthStencilRT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8_EXT,
Width, Height, 0, GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, NULL);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
GL_DEPTH_ATTACHMENT_EXT,
GL_TEXTURE_2D, DepthStencilRT, 0);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
GL_STENCIL_ATTACHMENT_EXT,
GL_TEXTURE_2D, DepthStencilRT, 0);still, getting INVALI_FRAMEBUFFER_OPERATION_EXT.

any ideas?