tags:

views:

345

answers:

2

I am using 3D textures for volume rendering of raw data. The raw data can be Luminance-Alpha or RGBA.

Currently, I read the raw data and set the alpha value such that the furthest row (or slice)would be opaque (Alpha = 1) and the nearest slice would be "transparent" (say alpha = 0.1) and and alpha values are interpolated.

Is there any way in opengl I can change these alpha values dynamically. i.e. based on events like rotation? Such that the furthest slice is always opaque?

I am using a scenegraph tool (www.openrm.org) for texture based volume rendering.

I guess I am not looking for code but any ideas I can do this efficiently in the GPU using OpenGL.

A: 

This one talks about "per slice alpha weight", which is what I intend to do (look at the pseudocode in the end)

http://www.ifi.uzh.ch/staff/stern/SciVis_WS2004/chstern/v100105/VolumeRendering/kulick/

Now, the trick is to re-compute per slice alpha weight as orientation changes.

Aditya
+2  A: 

Sounds like a perfect job for a shader...

However, if you are using axis aligned slices and create them on the CPU you could set a glColor4f with an alpha-component <= 1.0 and also set glTexEnv to GL_MODULATE. The color value will then be multiplied with the color value of your texture.

Maurice Gilden