How to set up a 3D texture with following settings



hi,

I have a 3D volume data with dimensions of dim[0], dim[1], dim[2]. Now
I need to set up a 3D texture using glTexImage3D, this 3D texture
should have following parameters:

Dimensions: dim[0], dim[1], dim[2]
Texture values: we need to store values in channel R and channel A,
the value range for each channel is (0, dim[0]*dim[1]*dim[2]) (it is
the multiplication of size of data in three directions).

My question is how to set each parameter of glTexImage3D to create
this texture? Which format should I use? Because data dimensions may
be 512x512x512, it is a very large value to store in channel R and
channel A.

void glTexImage3D
( GLenum target
, GLint level
, GLenum internalformat
, GLsizei width
, GLsizei height
, GLsizei depth
, GLint border
, GLenum format
, GLenum type
, const GLvoid *pixels
);

Many thanks for your help!

James

.



Relevant Pages

  • Re: How to return Texture Coords at mouse x y posiiton in openGlut/openGL ?
    ... > first half of g channel and for v on half of g and b ... > use this texture to draw you object (textured, ... > without anti-aliasing) in the back buffer. ... If you can store the scene/dataset hierarchically the intersection ...
    (comp.graphics.api.opengl)
  • Re: How to return Texture Coords at mouse x y posiiton in openGlut/openGL ?
    ... First create a texture where you encode u and v in say r channel and ... first half of g channel and for v on half of g and b ... without anti-aliasing) in the back buffer. ... If you can store the scene/dataset hierarchically the intersection ...
    (comp.graphics.api.opengl)
  • Re: How to return Texture Coords at mouse x y posiiton in openGlut/openGL ?
    ... First create a texture where you encode u and v in say r channel and ... first half of g channel and for v on half of g and b ... without anti-aliasing) in the back buffer. ... the drawback of this method is you need to draw your scene twice. ...
    (comp.graphics.api.opengl)
  • Re: multielement textures
    ... > need to use a dot product operator to extract out the individual ... The dot product operator burns up a texture stage, ... > most cards where you have to do FFP that leaves only a single texture ... For the alpha channel, ...
    (microsoft.public.win32.programmer.directx.graphics)
  • 3D textures & Max Size
    ... glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, mVolume.width, mVolume.height, ... Now, if my width, height & depth is 128x128x128, I am able to draw my ... However, if my width, height & depth is 256x256x256, my scene is drawn ... as if my texture data contained garbage - it does not. ...
    (comp.graphics.api.opengl)