View Full Version : Transparent Textures / Billboarding

07-29-2003, 10:39 AM
Hi All,
I could use a little help here although my problem(s) are a little tough and hard to describe.
My first problem is that I needed to visualize a 3-D volume for which I have the color of each voxel. Unfortunately, going through each voxel and making/coloring the geometry for them was a little much. The volume also needs to be transparent. So to bypass this problem, I made a little hack. My hack is that I divide the volume into many planar "slices" (lets say 32) and for each slice I make a texture from the voxel colors and paste the texture on top of the slices. Therefore I only have to redraw 32 quads as opposed to a lot of quads(thousands of voxels). There is a set of SLICES for each axis so that the SLICES hack isn't *too* obvious.

My problem is as such. To acheive the transparent effect of the volume, I made each slice (the actual geometry) have an alpha value and then each color on the texture to not have one so that the texture colors are simply RGB. I then set the usual
blending and I set the texture environment mode to be GL_MODULATE. The problem is that the "SLICES" are very noticable. It is very evident when you are looking through 1 or 2 or 3 SLICES even when they are the same color. It's as if you are looking through a tinted window. When you ook through one a certain amount of light gets through. When you look through two, less light gets through, etc. This effect is fine when viewing the slices head on, but at off axis angles, it no longer looks like a homogenous volume.

So, can anyone think of a way for me to keep the transparency, but eliminate this "tinted window" effect? I would like the volume to look like a homogenous volume from any angle, but at the same time drawing the volume geometry itself or using 3D textures are too slow. I am using openGL 1.1 and I do not have access to any pictures of the volume to make "3-D" looking 2-D textures to simple slap on the front of the volume. All I have are voxels and their colors. Any help is greatly appreciated.

Also, the geomtries behind/inside this transparent volumes lose their specular highlights. Any help with that would be good too.

07-29-2003, 04:23 PM
More slices with a lower alpha value is the way to fix this. LINEAR filters on the texture should also mitigate, perhaps with an alpha border to take the edge off.

You have a very common problem. Volume rendering has done this for years. It's a classic compromise between performance and quality when you trade slices against the visual artifacts you are describing.