From: thinman@netcom.netcom.com (Lance Norskog)
Subject: Object database rendering
Date: Thu, 9 Jan 92 13:44:03 PST



I'm playing around with complex Z-buffers as a hidden surface
system, where there's a few data items in each slot instead of
just a Z value.

I don't see that after backface culling we're going to have polys 
more than a few deep.  The following work better if the polygon 
database comes in a "mostly" front-to-back order.  This is the
case if the world database is sorted by larger object first.

A: just use an array of pairs of: (Zvalue, poly#).
When you project poly X, check all the corners.  If they are
all under poly Y, toss poly X.  Else, "paint" poly X
into the (Zvalue, poly X) tuples.  When all polys are done,
paint the screen from the poly numbers.  You can use
the Z values for mist or something.  Before filling the
Z array, clear it with the background poly.

If polys come in convex groups, you can write
both the poly number and its group number, and then check
new polys against the group numbers.  This gives a larger
area that will kill off more underneath polys.

B: each pixel is an array index, or empty.  The array is
a tuple of: Z value, object number, next index (or empty).
The effect is to have a linked list of polys for each pixel.
But, you only link the corners of the poly into the lists.

Now, if all the corners of poly X would fit under the same
poly Y, you can toss poly X since it is completely obscured
by poly Y.  If you use poly group numbers instead of poly
numbers, where the poly group is known to be convex, you have
a nice large area covered by a big "poly".

I really hate to see you wearing your fingers to bloody stumps
assemblerizing Hamlin&Gear's 1001 cases without trying something
simpler first :-)
