PDA

View Full Version : depth buffer sharing with pbuffer



pantxua
06-02-2004, 07:50 AM
Hi,
I'm using a pbuffer and I would like to share zbuffer between my two contexts (original and pbuffer) to use it for depth of field computing :

-active pbuffer
-draw scene
-inactive pbuffer (orginal context)
-get pbuffer's color buffer in a texture
-draw new scene with pbuffer's depth buffer

I've found the constant WGL_SHARE_DEPTH_ARB for pixel format in pbuffer but when i use it my screen is dark and i don't know why.

thanks

ravo
06-03-2004, 02:18 AM
Try reading the Pbuffers depth buffer and write these pixel values into framebuffer:

glReadPixels(x, y, width, height, GL_DEPTH_COMPONENT,...)
deactivatePBuffer(...)
glWritePixels(width, height, GL_DEPTH_COMPONENT,...) This should work, but I have no experience with performance.

ravo

pantxua
06-03-2004, 04:52 AM
thanks but this method is too slow. I'm searching a way to specify that i use the same zbuffers in the two contexts