Nicolas Gauvin (nicolas++at++cae.ca)
Mon, 2 Jun 1997 12:00:55 -0400
> Well, it seems that it is exactly the problem. I am drawing the decal
> children over the base and far away, outside the base. I really need this
> behavior because the decal is a shadow coplanar with the floor. The shadow
> can be moved and go out of the base floor.
>
In fact I just realized you were saying that from the beginning,
I should have read you initial mail more carefully.
> > If really need the stencil buffer to be cleared for each of your pfLayer
> > you could do it in a pre-draw callback but you'll get a performance drop.
> >
> It would be something like this?
>
> /* floordcs it the base children of the layer */
>
> pfNodeTravFuncs(floordcs, PFTRAV_DRAW, FloorPreDraw, FloorPostDraw);
> ........................................
>
> int FloorPreDraw(pfTraverser *trav, void *data)
> {
> glEnable(GL_STENCIL_TEST);
> glClearStencil(0);
> glClear(GL_STENCIL_BUFFER_BIT);
>
> return NULL;
> }
>
> int FloorPostDraw(pfTraverser *trav, void *data)
> {
> glDisable(GL_STENCIL_TEST);
>
> return NULL;
> }
>
I think you only need to call glClear(GL_STENCIL_BUFFER_BIT)
in the pre-draw CB, there is no need for a post-draw CB. Performer
will take care of enabling/disabling the stencil test. I don't think
you need to have the stencil test enabled in order to be able to clear the
buffer. You could also set this CB to the pfLayer node itself instead of
the dcs base for the same result.
--
Nicolas Gauvin CAE Electronics Ltd., 8585 Cote De Liesse
3D Graphics Software Saint-Laurent, Quebec, Canada, H4L-4X4
nicolas++at++cae.ca Tel: (514) 341-2000 x2275, Fax: (514) 340-5496
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
SGI DevForum 97 info: http://www.sgi.com/Forum97/
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:23 PDT