Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sdd.hp.com!decwrl!sgi!shinobu!odin!horus.esd.sgi.com!thant From: thant@horus.esd.sgi.com (Thant Tessman) Newsgroups: comp.sys.sgi Subject: Re: Alpha blending ... Keywords: Intersecting polygons, alpha blend Message-ID: <1990Sep6.165219.11745@odin.corp.sgi.com> Date: 6 Sep 90 16:52:19 GMT References: <1990Sep5.151623.12906@ux1.cso.uiuc.edu> <1990Sep5.171056.23011@odin.corp.sgi.com> <1990Sep5.190659.14015@ux1.cso.uiuc.edu> Sender: news@odin.corp.sgi.com (Net News) Reply-To: thant@horus.esd.sgi.com (Thant Tessman) Organization: Silicon Graphics Inc. Lines: 36 In article <1990Sep5.190659.14015@ux1.cso.uiuc.edu>, gautamm@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