Alpha blending ...

Thant Tessman thant at horus.esd.sgi.com
Fri Sep 7 02:52:19 AEST 1990


In article <1990Sep5.190659.14015 at ux1.cso.uiuc.edu>,
gautamm at kandinsky.ncsa.uiuc.edu (Gautam Mehrotra) writes:
> 
>         I am sorry I didn't make myself very clear -- I am trying to
> do transparent( translucent ) surfaces -- therefore the alpha
> blending.  The problem is that if I use the z-buffer ( which I am
> using), parts of intersecting polygons are not rendered at all ( the
> part which lies behind values in the z-buffer). I can get this 
> portion if I re-render the polygon with the zfunction changed to
> test for values of z GREATER than the values in the z-buffer.
> However, I  haven't been able to get the alpha values right. Does
> anyone have any experience with this ?

The 'hack' that the SGI demos use is to draw all of the solid
stuff normally, and then turn on the z-buffer write mask (using
zwritemask) and draw all the alpha-blended stuff.  It will
z-buffer correctly against the solid stuff without putting
anything in the z-buffer to mess up subsequent alpha-blended
stuff.

This isn't correct, but it looks okay for highly transparent
stuff and where the colors of the transparent polygons don't 
vary too much.

The 'correct' way is to turn off the z-buffer and depth-sort
the transparent stuff (painter's algorithm (maybe via BSPTree)).

This is a hard problem.  There are some other tricks
that give good approximations, but I don't know enough about
them to comment.

> 
> thanks,
> gautam

thant



More information about the Comp.sys.sgi mailing list