View Full Version : 3D Texture Problem
10-22-2004, 07:44 AM
I set up a 3Dimension volume array(128*128*64),each voxel of which is RGBA type,GLubyte form. I used glTexImage3D(...)to view the data as 3Dtexture data.
Then I drew a cube to map the texture on it.I use the anti-clockwise mapping for all the 6 surfaces. Of course, I used the glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA) for alpha displaying.However, I found the result was astonishing: Only the 6 surfaces are correctly displayed.But inside the volume,there is nothing.It seems all the voxels inside the volume had not been mapped.Why that happened? Is there any solution to display the whole texture data? I mean I want to map the volume texture to a cube for the purpose of accelerate the speed of displaying 3D data. Can anyone help me? Thanks in advance.
10-22-2004, 02:29 PM
Ok, first are you sure you disabled depth test ?
Second point, 3D texturing works, but there are no hardware I am aware of that can display voxels natively.
You need to do it yourself.
A quick start is to draw a lot of slices inside your cube, still with the 3D texture enabled. Each quad will be mapped by the 3D texels, if you set up correctly the 3 texture coords with glTexCoord3f ( GLfloat s, GLfloat t, GLfloat r);
There have been some discussion and very good documents about such topics in these boards, some searches about volumetric rendering medical data should return useful info.
Some random googling returned :
http://www.angelfire.com/art/ung/volume/volume.html (french only sorry)
I hope it will help you.
10-22-2004, 06:50 PM
First,thanks for your kindly help.But I am still puzzled... I have tried glDisable(GL_DEPTH_TEST)and also glEnable(GL_DEPTH_TEST).There is no difference. In my opinion, I should enable the depth test. I think the buffer need the depth info to take in each slice and to blend slice by slice then.Without the depth info, how can the buffer process the texture mapping? For example,mapping forward or backward? After all, to blend from front to back is different form the process back to front... Is there any mistakes?
Also, I am interested in the process of tex3D mapping. Why there is only surface rendering rather than volume rendering? If it only uses surface rendering, there is no need for me to supply blend form with glBlendFunc()at all.
I am right?
How should I arrange the slices using 3DTexture? Do I must arrange the slices perpendicular to the camera view direction? Or the OpenGL pipeline would do it for me automatically?
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.