Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: pbuffers and 3d textures

  1. #1
    Intern Newbie
    Join Date
    Jul 2004
    Location
    ISU VRAC
    Posts
    41

    pbuffers and 3d textures

    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.
    biv

  2. #2
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,256

    Re: pbuffers and 3d textures

    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()
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  3. #3
    Intern Newbie
    Join Date
    Jul 2004
    Location
    ISU VRAC
    Posts
    41

    Re: pbuffers and 3d textures

    thanks for the input. I finally go it to work!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •