PDA

View Full Version : FBO woes (DEPTH_STENCIL_EXT)



Java Cool Dude
12-02-2005, 05:19 PM
glBindTexture(GL_TEXTURE_2D, depthStencil);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8_EXT,
width, height, 0, GL_RGBA, GL_INT, NULL);Using that piece of code, glTexImage2D returns GL_INVALID_OPERATION =/
Anybody got that to work with FBOs?

jra101
12-02-2005, 07:52 PM
Type parameter needs to be GL_UNSIGNED_INT_24_8_EXT.

sqrt[-1]
12-02-2005, 11:47 PM
If that is true, someone needs to update the example code at:
http://oss.sgi.com/projects/ogl-sample/registry/EXT/packed_depth_stencil.txt

As what he is doing seems ezactly like the given example..

Java Cool Dude
12-03-2005, 06:24 AM
Originally posted by jra101:
Type parameter needs to be GL_UNSIGNED_INT_24_8_EXT.Believe me I already tried that and the error persisted =/

Mars_999
12-03-2005, 06:38 AM
Hey JavaCoolDude, what hardware is it on? I am curious... I don't have an answer but would be nice to know to see if all ATI or Nvidia people are having this issue.

Java Cool Dude
12-03-2005, 06:44 AM
GF6600GT using the 81.95 drivers =/

jra101
12-03-2005, 09:03 AM
You also need to change the format parameter to GL_DEPTH_STENCIL_EXT. Something like this:

glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8_EXT, width, height, 0, GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT);I believe the examples in the spec have been fixed but an updated version hasn't been uploaded to the extension registry yet.

Java Cool Dude
12-03-2005, 10:34 AM
Actually that fixed it =D