Michael Jones (mtj++at++isdn-celeste.corp.sgi.com)
Wed, 14 Aug 1996 08:52:37 -0700
> So how do you erase the stencil information when you are done? (the extra pass)
You don't erase it. You don't care what's in the stencil planes unless
you have enabled stencil mode, and you only do that as you are rendering
a new set of coplanar layers, the first of which (the base) writes to
the stencil planes. By the time the frame's complete, there is probably
a bunch of junk in the stencil planes, but you don't care.
>Your approach will only work if you don't have any occlusion between
>decal surfaces, or if you depth sort.
Not so. I must have explained poorly, as stencil-based coplanarity is
the deluxe mode and always works perfectly. Here are the rules for
Performer layer nodes:
1. an arbitrary set of coplanar base polygons.
2. a set of first-layer-above-the-base polygons that are
coplanar with those in step #1, and are contained within
the boundary of the polygons in step #1. For example, if
#1 is the runway, #2 is the stripes and they cannot extend
off the runway -- they are paint and can only go where the
base layer is.
3 - N, layers just like #2, that have increasing visual
priority. If they were painted, they would be painted in
order: 1, 2, 3, ..., N.
Now, to render this ensemble using stencil-planes, the following
approach does the job without error:
a. enable "set stencil based on depth-compare pass/fail" mode
b. render the base layer (#1)
[note that at this point all of the pixels (subpixels on re/ir) in
the area covered by #1 have a stencil bit that means: 1==visible,
0==invisible]
c. disable depth comparisons.
d. disable stencil updates.
e. enable "only draw where stencil == 1" mode.
f. render layer #2.
[note that since layer #2 is coplanar with #1, and since it is "inside"
the area of #1, the pixel writing can not touch any pixel or sub-pixel
not visited in step "b", thus the stencil bits are a valid guide to the
visibility of this layer.]
g. loop through the remaining layers and render them like step "f".
[note that the pfLayer (or pfDecal) ensemble is now correctly rendered]
h. disable stencil comparisons.
i. enable depth comparisons.
j. continue with drawing.
This does work well without exception.
Michael
Be seeing you, Phone:415.390.1455 Fax:415.965.2658 M/S:8U-590
Michael T. Jones Silicon Graphics, Advanced Graphics Division
mtj++at++sgi.com 2011 N. Shoreline Blvd., Mtn. View, CA 94039-7311
"Competition is a by-product of productive work, not its goal. A
creative man is motivated by the desire to achieve, not by the desire
to beat others." -Ayn Rand
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:21 PDT