Re: Color & Alpha calculation

New Message Reply Date view Thread view Subject view Author view

Dave Akers (dla)
Mon, 20 Mar 2000 16:21:52 -0800


Hi Frank,

 What you're seeing is not specific to Volumizer, but to the blend
function that you are using to composite the slices together. This is
controlled by the OpenGL call glBlendFunc(). The two arguments to this
function specify how to blend an incoming fragment's color with the
value already in the frame-buffer. In the voglDraw.cxx example, we use
front-to-back rendering with the blend function set to GL_SRC_ALPHA,
GL_ONE_MINUS_SRC_ALPHA.. This means that the blended pixel is calculated
as a*i + (1-a)*f, where a is the texture's alpha value, i is the incoming
fragment color, and f is the value currently stored in the framebuffer.
(Each slice is composited into the scene weighted according to its alpha
values.) So, as you can see, the lower your texture alpha values are, the
more the background color is going to influence the result, since you can
see through your volume to the background.

  On the right side of your test image, your alpha is lower and so more of
the background shows through (hence the lower pixel values, since the
background is black.) If you want a different effect for some reason,
modify your alpha values or change your blend function. Make sense? Please
clarify if I'm not understanding what your question was..

Thanks!

-Dave

 On Wed, 15 Mar 2000, Frank B. Sachse wrote:

> Hallo,
>
> we use Volumizer to simulate the emission of particles out of the human
> body. We applied an anatomical model of man
> (http://www-ibt.etec.uni-karlsruhe.de/MEETMan.htm) to calculate the
> tissue specific absorption. Alpha values are derived from the
> absorption, color values are set depending on the concentration of a
> radioactive substance. The rendered pictures are used for further
> calculation in the area of dosimetry.
>
> We were suprised that the color of the background influences largely the
> values in our simulations. A reduction of alpha values leads to lower
> pixel values using black background, it leads to higher values using a
> white background.
>
> We expected to see higher pixel values in regions with low alpha,
> because no emission is absorpted. In regions with high alpha only the
> surface can emit, so the pixel values should be low.
>
> An example to illustrate this non physical behaviour: a 16x16x16 lattice
> with color 255, alpha 32 and 255 leads to pixel values 100-200 resp. 204
> when using a black background.
>
> I attached a visualization of the lattice with black background. On the
> left side of the lattice alpha is set to 255 and on the right side alpha
> is set to 32.
>
> Thanks in advance for explaining this behaviour of volumizer
>
> Frank Sachse
>
> --
> Frank B. Sachse
> Institut fuer Biomedizinische Technik
> Universitaet Karlsruhe
> D 76128 Karlsruhe
> tel 0721 608 3851
> fax 0721 608 2789
> email fs@ibt.etec.uni-karlsruhe.de
> www http://www-ibt.etec.uni-karlsruhe.de/~fs
>
>
>


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Mar 20 2000 - 17:50:28 PST