Hi people,
I’m doing a research where I need to do depth peeling. So, instead of using an array of 2D textures I’m using a Texture3D and rendering in it multiple times in different Z values.
I’m doing the following to setup and render one pass:
GLuint depthImg;
glGenTextures(1, &depthImg);
glBindTexture(GL_TEXTURE_3D, depthImg);
glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage3D(GL_TEXTURE_3D, 0, GL_DEPTH_COMPONENT24, width, height, 4, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL);
glFramebufferTexture3DEXT( GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_3D, depthImg, 0, 0);
At this point, when I get the completness of the frame buffer, I receive the following value:
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
Does someone knows why this is happening? Is there something wrong with this code?
Thanks a lot.
Jose Ricardo