PDA

View Full Version : Direct transfer Depth Buffer to texture



pkuloop
09-21-2003, 10:06 AM
Is there any quick method direct transfer Depth information into on texture without read back to main memory?

rgpc
09-21-2003, 05:05 PM
glCopyTexSubImage2D() with an internal format of GL_DEPTH_COMPONENT

pkuloop
09-23-2003, 02:36 PM
I try to use pbufer and directly bind the pbuffer to a texture.
For RGB it works.
wglBindTexImageARB( pbuffer.hpbuffer, WGL_FRONT_LEFT_ARB )

however, when I use WGL_DEPTH_COMPONENT_NV
it fails.

pkuloop
09-23-2003, 06:06 PM
Now I get it right

add WGL_BIND_TO_TEXTURE_DEPTH_NV, TRUE,
for the pixel format
and WGL_DEPTH_TEXTURE_FORMAT_NV, WGL_TEXTURE_DEPTH_COMPONENT_NV,
for the pbuffer attib

eyebex
10-10-2003, 12:11 PM
what's the best way to do this on ati boards? use gl_arb_depth_texture somehow?