Re: Stencil question

New Message Reply Date view Thread view Subject view Author view

Nicolas Gauvin (nicolas++at++cae.ca)
Fri, 30 May 1997 14:04:38 -0400


On May 30, 5:50pm, Joaquin Casillas Melendez wrote:
> Subject: Re: Stencil question
>
> >
> > One thing that perfly does is to call pfdCombineLayers wich actually
> > forces all your pfLayer mode to DISPLACE instead of STENCIL!
> > This might explain the results you are getting.
>
> Well, I have deleted that line and I'm getting the same result. I have
> checked the pfLayer mode every time and the mode is ok (PFDECAL_BASE_STENCIL)
> I think that the sencil value is not correctly being updated when the
> viewpoint changes, or something similar.
>

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.

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.

-- 
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

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:55:19 PDT

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