Re: High IMPACT and Transparency

New Message Reply Date view Thread view Subject view Author view

Dewey Anderson (dewey++at++evt.com)
Mon, 11 Mar 1996 17:28:23 -0800


>>We have just upgraded one of our machines to High Impact graphics and
>>are experiencing problems with polygons textured with Alpha components
>>(i.e. IA, RGBA).
>>
>>The problem is that polygons containing alpha in their texture
>>disappear when viewed through another polygon with alpha.
>
>Sounds like classic Z buffer discard of more distant polygons. Z buffer knows
>nothing about transparency.

Sounds a lot like a problem I had until I looked into the "alpha function". As
Greg said, the Z buffer doesn't know about transparency but by setting an alpha
function you can make completely transparent pixels not affect the Z buffer. I
picked an alpha value of 10 arbitrarily as a cutoff for transparent:

  // Set alpha function to clip off alpha values less than 10.
  // This is needed to make low alpha pixels actually NOT be drawn at all.
  // THAT is necessary so that z-buffer isn't filled in by clear pixels.
  gstate->setMode(PFSTATE_ALPHAFUNC, PFAF_GREATER);
  gstate->setVal(PFSTATE_ALPHAREF, (10.0f/255.0f));

If the edges of your texture are soft you'll notice some shading at the edges
since the cutoff for not effecting the z buffer is abrupt. It WOULD be nice if
Performer sorted things so that layers of transparency could be stacked, but
then, it wouldn't really need a z-buffer at all if did that. (Painter's
algorithm.) I assume that's computationally way too expensive.

Dewey K. Anderson
Evolving Video Technologies
Arvada, Colorado


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:32 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.