Originally posted by powerpad:
[b]
Is there any other method to get the depth buffer contents into a texture (other than glReadPixels)?
Does glCopyTexImage2D support copying from the depth buffer?[/b]
yes you answered your question yourself. you can use glCopyTexSubImage2D to copy the contents of the depth buffer into a texture. on nv hardware i think you can even bind the depth buffer of a pbuffer directly as depth texture.
Then again, OpenGL is not part of Microsofts strategy, so don’t expect it to answer all your questions.
In addition to searching the web (or posting on this forum) the OpenGL 2.0 spec may be useful. It’s not easy to read though. But at least it’s available on the site.
To copy the content of the depth-buffer into a texture, the texture needs to be of the type DEPTH_COMPONENT (there is an extension ARB_depth_texture or so, which defines this). If the texture is of this type, then glCopyTexSubImage will automatically copy from the depth-buffer instead of the color-buffer.
yes I found the depth buffer read and glCopyTex** in the relevant extension.
So there is a non NVidia extension that deals with this texture rectangle…
I read the paper by Chris Wynn and he covers (of course) only the NVidia site.
But how do I set up my pbuffer to support this non power of two texture since I define