Joaquin Casillas Melendez (jcasilla++at++glup.eleinf.uv.es)
Mon, 2 Jun 1997 10:43:07 +0100 (WETDST)
> Is it possible that you are seeing this behavior on regions of the screen
> that end up not being covered by your base child? That would explain it.
>
> You child must always be entirely contained by your base (in screen space) in
> order for the stencil algorithm of pfLayer to work. It's because
> pfLayer doesn't clear the whole stencil buffer before drawing its children
> (for obvious performance reasons).
> It only updates the region covered by the base depending on the result of the
> depth test. If your children end up outside this region you will be comparing
> stencil values left from previous pfLayers or random values which are not
> guaranteed to be 0.
>
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.
> 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;
}
>
> --
> 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
>
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ Joaquin Casillas Melendez | email: jcasilla++at++glup.eleinf.uv.es _/
_/ ARTEC (LISITT) | _/
_/ Dept. Electr. & Informatics | Phone: +34 6 360 4484 Fax: +34 6 361 6198 _/
_/ University of Valencia | Address: Hugo de Moncada 4. 46010 Val.(SPAIN)_/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
=======================================================================
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