■ HBB LIBRARY OF THE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN 5/0.84 iJHor m.590-5% Cop -X Digitized by the Internet Archive in 2013 http://archive.org/details/designofalgorith592dono UIUCDCS-R-73-592 7/6. W /H x s , E (3.7,1.8) (f) Sampling grid and samples (note exact values of vertex E) Figure 3. Coordinate Systems in a raster frame buffer or just a large memory; this can then be displayed either on a television (raster) display or a precision CRT. The television raster lines correspond to the scan lines at the same position. Figure 4 is a sample shaded rendition. Figure k. Example of a Shaded Rendition 2. PREVIOUS WORK The display algorithm we have designed breaks into five parts, with the following flow of control: (Start) Polygon Clipper -*■ Special Sorter -»■ Face Drawer + Segment Shader \ \ // Face Splitting (Display) The basic idea of ordering faces and using the frame buffer to delete hidden parts was first considered in a sim- plified manner suitable for hardware implementation by Schu- macker [8l; Newell [1 ] later independently augmented the idea to a method that works in general. Our special sorter works in the same way as Newell' s, but we have modified their non- deterministic strategy to a deterministic one to aid our justification and (informal) proof of it. The method we use to sample and draw faces is a slightly altered and corrected version of the one embedded in Watkin's visible surface al- gorithm [6], The segment shader uses the same method to do smooth shading as found in Gourad [ 2 1, and to display trans- parent faces as found in Newell. New methods described here are a shading algorithm that removes jagged edges and compensates for faces disap- pearing due to sampling error, and a face splitting algorithm 8 that can also be used for polygon clipping. Since they do not use any special property of the Newell special sorter, these algorithms may be easily adapted for use with implementations of Watkin's or any other similar visible surface display method. In this thesis, we will start out first describing the special sorter so as to get an initial grasp on the vis- ible surface problem. The face splitter required by the special sorter and the polygon clipper will then be discussed simultaneously, since they are closely connected. The face drawing routine is then described, both for completeness and also because it is affected by the shader. The special shader is the last algorithm to be covered because we must then con- sider the entire effect of the program up to that point for a proper understanding of its processing. 3. VISIBLE SURFACE DETERMINATION The display problem can be divided into two steps: at each sample point, we must find out which face of those input is visible. Then, we must compute the correct shad- ing value for the face at that sample point. Our approach to visibility determination is suggest- ed by the following experiment. Figure 5a shows the (line drawing) projection of two opaque squares, with the hidden part dashed. The picture can be considered to show a pre- cedence relation between squares A and B, where AA, we sample and shade (draw, henceforth) A and put the result into the frame buffer first. Then we draw B, overwriting whatever was already in the frame buffer. The view now in the buffer is precisely the desired sampling of the visible portions of the scene in Figure 5a! This means that visibility determination for a number of faces can be done by finding a partial ordering under the above precedence relation, and drawing them out, one by one. For two faces A and B, the possible relations are exhausted by: 1. A