PDA

View Full Version : GL_TEXTURE_3D



alark
07-01-2003, 05:32 AM
Hi,
I have a cube with a checkered Image mapped onto it using a 3D texture. Now, if I read a volume which I have been using for volume rendering and fill the same array with the voxel values, why cant I see the actual volume. I do have alpha blending enabled and
still it looks quite bad.
thanks,
alark

Relic
07-01-2003, 06:19 AM
That's a funny idea. http://www.opengl.org/discussion_boards/ubb/smile.gif
If you don't draw geometry which samples the inside of the volume you won't see the inside data.
The cube is just six quads, but you'd need at about one quad per voxel slices to sample the inner region.
One way to do this is to draw quads orthogonal to your current view direction slicing through your volume from back to front using alpha blending and/or alpha test to remove areas of low density.

Lighting this gets more complicated.
Check this out: http://graphics.cs.ucdavis.edu/~steoh/research/schlumberger/prelim/PCHardware.pdf

alark
07-01-2003, 08:14 AM
thanks a lot. I thought that it was a preposterous idea from the beginning but i just had to try it. does that mean that you basically have slices and each slice obtains its texture from the 3D texture?
thanks a lot,
alark

Klaus
07-01-2003, 08:56 AM
Exactly.

alark
07-01-2003, 10:54 AM
hi,
i might be asking extremely straightforward questions, but please help.
Firstly, I am trying to draw just a quad with the first slice of the 3D texture assigned to texture it and am using this:

glTexCoord3f( 0.0f, 0.0f, 0.0f); glVertex3f(-1.0f,-1.0f, 1.0f);
glTexCoord3f( 1.0f, 0.0f, 0.0f); glVertex3f(1.0f,-1.0f, 1.0f);
glTexCoord3f( 1.0f, 1.0f, 0.0f); glVertex3f(1.0f,1.0f, 1.0f);
glTexCoord3f( 0.0f, 1.0f, 0.0f); glVertex3f(-1.0f,1.0f, 1.0f);

which doesnt show the right texture. Now, if I use

glTexCoord3f( 0.0f, 0.0f, 0.0f); glVertex3f(-1.0f,-1.0f, 1.0f);
glTexCoord3f( 1.0f, 0.0f, 1.0f); glVertex3f(1.0f,-1.0f, 1.0f);
glTexCoord3f( 1.0f, 1.0f, 1.0f); glVertex3f(1.0f,1.0f, 1.0f);
glTexCoord3f( 0.0f, 1.0f, 0.0f); glVertex3f(-1.0f,1.0f, 1.0f);

the only difference being the Z tex coordinates for 2nd and 3rd vertex, the quad gets the right texture mapped onto it. I dont know how this works and was thinking that I have to understand this to get the entire volume rendering to work.

Another thing I wanted to ask was if using the 'efficiently using graphics hardware in vol rendering applications' by westermann, ertl is a good start for some non-optimized texture mapped vol rendering.
Thanks a lot for all the help.

Alark

JasonM
07-01-2003, 10:59 AM
The RADEONVolVis (http://www.ati.com/developer/sdk/RADEONSDK/Html/Samples/OpenGL/RADEONVolVis.html) sample (which includes source) does what you're looking for.

-Jason

Klaus
07-01-2003, 12:26 PM
You could also have a look at last years Siggraph course on volume rendering: http://www.cs.utah.edu/~jmk/sigg_crs_02/courses_0067.html

Klaus

alark
07-02-2003, 05:54 AM
Hi,
A few more questions. The siggraph 02 collection of presentation and course notes is just awesome. That is where I found out about the MIP extension. Thanks.
a few questions:
1) when i use this
glEnable(GL_BLEND);
glBlendEquationEXT(GL_MAX_EXT);
glBlendFunc(GL_SRC_ALPHA,GL_ZERO);
glBlendFunc (GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);

it works perfectly and i can see the mip volume. now when i remove the glBlendEquationEXT() line, it shouldnt it technically show the direct rendered volume? But it doesnt. Now if replace the earlier
glBlendFunc() with glBlendFunc(GL_DST_ALPHA,GL_ONE);

it shows a volume. This seems very weird. Any ideas, suggestions ?

2) About 2D multitexturing, do you use 2D textures or a single 3D texture. It looks like you have to use 3 copies of object aligned 2D textures, but just wanted to make
sure.

Thanks,

alark