Dewey Anderson (dewey++at++evt.com)
Mon, 11 Mar 1996 17:28:23 -0800
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
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:32 PDT