glGenFramebuffersEXT(1, &id);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, id);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, TextureID, 0/*mipmap level*/);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, depthTextureID, 0/*mipmap level*/);
is the above code correct?
I want to render to a depth texture but all I saw was black. How is that possible if I clear depth to 1.0?
If I make a render buffer and attach to the FBO instead of using a depth texture, I render and I glCopyTexSubImage2D to the depth texture and then my depth texture contains valid values (white with varying degrees).
The color texture looks fine in both cases.
glGetError returns no errors and the framebuffer status is ok.