View Full Version : pbuffers and 3d textures

08-13-2004, 10:05 AM
The answer to this may be obvious but I can't find it out "there" anywhere. Is it possible to access 3d textures when rendering in a pbuffer?
Basically I want to draw a quad that fills the pbuffer and have it textured w/ a slice of my 3d texture. Then I would like to update a slice of another 3d texture w/ the image in the pbuffer.
I have tried just a colored quad and then using that as my update to the 3d texture but that didn't work either.

In my display routine I basically activate my pbuffer, draw a quad and then specify the texCoords and verts for my quad. Then I try to
make a call to glCopyTexSubImage3D() w/the appropriate params. Later I just try to display the updated texture using a volume rendering technique. The volume rendering has worked up until I tried to use the above mentioned "texture update in pbuffer madness"!!!

The only examples I've seen using pbuffers use 2d textures(i.e. glCopyTexSubImage2D()) so I'm thinking that is my problem. But maybe I need to specify certain attributes when I allocate my pbuffer or something else I may be over looking .
Thanks in advance for any help.

Sorry if this is a "newbie" question but I didn't get any responses w/ my post on the "newbie" board.

08-17-2004, 09:14 AM
It should work fine. Make sure the p-buffers modelview and projection matrix are right, the 3D texture is accessible in the p-buffer (wglShareLists or create it in the p-buffer context).

You can use glReadPixels to view the contents of the p-buffer before calling glCopyTexSubImage3D()

08-21-2004, 08:17 PM
thanks for the input. I finally go it to work! :D