Re: transparency
John Rohlf (jrohlf++at++tubes)
Tue, 24 Jan 95 12:06:49 PST
>
> On Jan 20, 4:04pm, Lance R. Marrou wrote:
> > Subject: transparency
> > I get a different result from using this:
> >
> > pfGStateMode( exp_gstate, PFSTATE_TRANSPARENCY,
> > PFTR_ON|PFTR_NO_OCCLUDE );
> >
> > as opposed to:
> >
> > long exp_trans_state;
> > long PreDraw(pfTraverser *trav, void *data)
> > {
> > exp_trans_state = pfGetTransparency();
> > pfTransparency(PFTR_ON|PFTR_NO_OCCLUDE);
> > return PFTRAV_CONT;
> > }
> >
> > long PostDraw(pfTraverser *trav, void *data)
> > {
> > pfTransparency(exp_trans_state);
> > return PFTRAV_CONT;
> > }
> >
> > The pre-draw and post-draw function callback technique provides
> > the correct transparent geoset (of course the alpha values are
> > set correctly). However, setting the state mode works for
> > allowing transparency, but it makes the geoset occlude other
> > transparent geometry. I have attempted just about every combination
> > of state mode to get it to work the same, but no luck. Obviously,
> > I could just stick to the function callbacks, but I want to know
> > why setting the state doesn't work.
> >
> > I have images which show the results of both methods for those
> > interested to see them.
> >
>
> >
> >-- End of excerpt from Lance R. Marrou
>
> Hi Lance,
> your problem may be that when you set the geostate transparency on
> performer sorts associated geometry but when you simply add callbacks performer
> cannot know what youre doing in there and so doesn't sort. The apparent result
> is very different because of the drawing order, although geometry is still
> being drawn in exactly the same way.
>
This is true. When you use callbacks, sorting is disabled so
that transparent objects are not drawn last. However, NO_OCCLUDE should
still work I think.
This archive was generated by hypermail 2.0b2
on Mon Aug 10 1998 - 17:50:53 PDT