next up previous
Next: Software Methods Up: Displaying Important Edges and Previous: Displaying Important Edges and

Hardware Methods

  Using multi-pass rendering [1] there are several ways to extract silhouettes. The algorithm presented in the SIGGRAPH 1998 OpenGL Course does not capture internal silhouette edges and requires four passes of rendering. We recently found out that there is concurrent work similar in spirit to our hardware methods [2]. Below we provide algorithms which require two or three rendering passes and capture internal silhouettes.

In a polyhedral model, a silhouette is an edge that is connected to both a front facing and a back facing polygon. The following is pseudo code for the basic algorithm:

draw shaded front faces
draw front faces in line mode:
        setting only stencil
draw back faces in line mode:
        setting color if stencil was set
        decrementing stencil if drawn

To draw lines over polygons, the PolygonOffset extension (or PolygonOffset function in GL 1.1) [18] is needed. This function effectively modifies the depth values of the first pass based on the slope of the triangles and a bias factor. This technique can create something similar to a silhouette, effectively a halo. The depth values are pushed forward instead of back to allow lines to be rasterized over faces. Then wide lines are drawn. Where there are large discontinuities in depth (silhouettes and boundaries), only part of the line is drawn. This method requires only two passes instead of the three listed above, but can be fairly sensitive to the parameters of the polygon offset function. Using OpenGL hardware makes the implementation simple, however, it limits the thickness of the edge lines.

Another hardware technique is to add the edge lines to a shading environment map as a preprocess. However, as shown in Figure 7(a), the lines lack crispness, and if the model varies greatly in curvature, there may be large black regions. In order to include silhouettes on the feet of the cow in Figure 7(b), we have to set the threshold low enough to draw lines in these high curvature regions. This causes regions which have relatively low curvature to be filled in with black. Although this effect produces some interesting, artistic results, it may be inappropriate for technical illustration.

next up previous
Next: Software Methods Up: Displaying Important Edges and Previous: Displaying Important Edges and