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 2 of 2

Thread: glTexImage3D data

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2011
    Posts
    25

    glTexImage3D data

    I have been getting to know the ins and outs of glTexImage3D. One thing that is still missing in my brain is exactly how the data is layed out. I know it's width*height*depth*4 in size. Have any of you seen some good documentation or diagrams on the topic of data layout within that vast size? I have read the *4 refers to voxels. Is each voxel 24 bits = red-green-blue-opaque? Are the voxels arranged (row (aka width) * height (aka height)) * depth? Or is there another layout structure involved within the data?

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

    Re: glTexImage3D data

    3D textures are stored as slices. Each slice is width * height.
    There would be Z number of slices where Z = depth

    As for the *4
    http://www.opengl.org/wiki/Common_Mi...d_formats_.233
    ------------------------------
    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);

Posting Permissions

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