Hidden Surface Algorithms
Home Up Research Ultimate List

This is my write-up for the following assignment:

    Read A Characterization of Ten Hidden-Surface Algorithms by Sutherland, Sproull, and Shumacker. Choose one object-space method and one image-space method from the ten. Write a paper, in the form of a web page, describing how your chosen methods work. Compare and contrast your two methods with each other and with the Z-buffer (their "brute force") algorithm.

 I chose Loutrel's algorithm as an object-space algorithm because of it is the "cleanest" (in my mind) of three very similar algorithms and Warnock's as an image-space algorithm because of its simplicity and elegance.  I found it challenging to compare the image-space algorithms to the object space algorithms in the paper which all only solve for edge visibility.

Comparing Loutrel, Warnock, and the Z-Buffer

    The change from strictly rendering wireframe images with transparent faces to either opaque wireframe or shaded images required visibility determination.  In the former case, "strokers" could still be used, and and exact solution was necessary.  Raster displays were begin used for shaded images.   Because rasterization typically only uses information from discrete samples to generate pixel values, the visibility problem needs only to be solved in at these sample points in the image plain.  Shaded images require determining visible polygons, while opaque wireframe images only need edge visibility.  In the paper A Characterization of Ten Hidden Surface Algorithms by Sutherland, Sproull, and Schumaker, object-space solutions to the opaque wireframe hidden-surface problem are discussed along with image-space solutions to the shaded polygon hidden-surface problem.  The Loutrel algorithm will be presented as an example of the former, and Warnock's algorithm as an example of the latter.  The Z-buffer algorithm will also be presented and a comparison of the three algorithm's will follow and the conclusion will attempt to explain the predominance of the the Z-buffer algorithm.
    Loutrel's algorithm is very similar to two other object-space algorithms for hidden-line removal, Appel's algorithm and and that of Galumbretgi and Montanari.  The basic idea is to break up each edge into visible and invisible regions.  The number of occluding faces is determined for segments of the edge.  This is count is called by Appel the quantitative invisibility and by Loutrel the order of invisibility.  The points along the edge at which the order of invisibility changes occur at intersections between the edge of consideration and the edge of a front-facing face.  This is not strictly true, but is made so by disallowing interpenetrating faces.  Unlike Appel, Loutrel solves the intersection test in image space and then uses a depth comparison at the point of intersection to determine which edge is in front at the point of intersection.  The algorithm divides the line into segments of various orders of invisibility.  By traversing length of the edge, the order of invisibility at the terminating vertex may be used as the order of invisibility for edges that share this vertex.  (Though in the case that the vertex connects multiple front facing polygons which occlude each other, the count will have to be adjusted).  The segments of each edge that have a zero order of invisibility are the visible edges in the resulting image.  The endpoints of these segments can be used as input to a "stroking" device that draws ideal lines on a phosphor coated-screen.
    Warnock's algorithm is cleverly presented in A Characterization as a radix 4 quicksort.  Warnock observed that if a region is entirely covered by a single polygon closer than all other polygons at all points in the region or is intersected by no polygons, then the hidden-surface question has been answered.  The algorithm works by recursively subdividing rectangular regions of the image plane into four smaller rectangular regions until the either case holds for all leaf-level regions.  The per-region processing goes as follows:  If no face intersects the region than the hidden-surface question for this region has been trivially answered and there is no need to further subdivide this region.  If one or more polygons fully contain the region then it must be determined whether one of these polygon is the closest polygon over the entire region.  This is done by checking the depth of all intersecting polygons with the corners of the region that they intersect.  If such a polygon is found then the hidden-surface question has been solved for this region.  Otherwise the region is subdivided into four subregions by axis aligned lines.  The same rules are applied to each subdivision.  Note that each region does not need to check every polygon.  Polygons that do not intersect a region will not intersect that subregions and polygons that fully cover a region will cover subregions.  The algorithm gracefully handles interpenetrating polygons by subdividing until the polygons do not interpenetrate in any subregions.  This is handled without adding any special rules.  Furthermore, by allowing sub-pixel subregions, the algorithm can calculate the integrated color for each pixel.  At the time that A Characterization was written a major complaint about Warnock's algorithm was that it did not produce results in a top to bottom, right to left manner.  This is no longer relevant because full frame-buffers are commonplace
    The Z-buffer is a brute-force approach for hidden-surface determination.  Each screen pixel stores a Z or depth value.   The depth value starts at infinity.  Polygons are scan-converted into the pixel grid.  Before a pixel is overwritten the Z value of the polygon at the pixel center is compared to the value already in the Z-buffer for this pixel.  The pixel is only written when the computed Z value is less than the Z-buffer value.  If the pixel is written, the Z-buffer value is overwritten.  Typically 1/Z is actually stored in the Z-buffer.

    One way by which these algorithms can be analyzed is their complexity order.  Loutrel's algorithm grows as the square of the the number of edges because it must find all on screen edge/edge intersections.  The complexity is independent of the display resolution, and in fact produces an exact, unsampled result.  The Z-buffer grows linearly with both the number of pixels and faces. Warnock's also grows linearly with the number of faces, but is also dependent on their object-space complexity.  Many closely spaced interpenetrating polygons will yield worse results for the algorithm than the same number of polygons with low depth complexity.
    It is also useful to compare the requirements each algorithm makes on the input data.  Loutrel requires adjacency information in order to re-use the calculations of the order of invisibility at vertices.  This algorithm also requires that the faces do not interpenetrate.  Warnock's algorithm and the Z-buffer make neither of these requirements.  Interestingly, all three algorithm's will tolerate concave faces.
    Both the Loutrel and Warnock algorithms attempt to take advantage of coherence.  Loutrel takes advantage of coherence at the vertices when reusing order of invisibility calculations.  Warnock's algorithm uses spatial coherence to terminate early in its recursive descent.  It also uses spatial coherence to limit the computation required at subregions.  It is odd that the most successful algorithm, the Z-buffer, uses no coherence at all.  Calculation is performed independently at each pixel and there is no retention of information between frames.  This is surprising because often in computer graphics good use coherence is the key to a successful algorithm.

    So why then is the Z-buffer so successful?  Compared to the algorithms covered in A Characterization, the Z-buffer is simplistic and memory intensive.  One reason is its simplicity and independent nature.  It is ideally suited for hardware.  The action is exactly the same per primitive per (covered) pixel.  The only variable is whether the pixel and Z-buffer are written.  There is one simple comparison to make and can be easily parallelized.  The major drawback of the Z-buffer is its per-pixel memory requirement.  This has been made a non-issue by the rapid decline in memory costs.  The Z-buffer is also desirable because of its flexibility.  It works well for any type of polygons and any distribution of polygons.  It could even work for non-polygonal primitives.  The results of the Z-buffer have proven useful for uses other than the hidden-surface problem such as shadows and textured depth meshes.