Abstract:
In rendering an image of a 3D surface, a computer system obtains a digital model that includes data points defining vertices for triangles that represent 2D faces of the 3D surface. The computer also obtains a plurality of vectors, each defining a surface normal for the 3D surface at a corresponding one of the vertices. The computer applies an algorithm, such as, Loop&#39;s Equation, to the data points to create new data points defining new vertices that subdivide the triangles into smaller triangles. The computer applies the same algorithm to the vectors to calculate new vectors, each defining a surface normal at a corresponding one of the new vertices.

Description:
TECHNOLOGICAL FIELD 
     This application relates to creating and rendering 3D surfaces in a computer system. 
     BACKGROUND 
     Many computer graphics applications render complex three-dimensional (3D) surface geometries by iteratively refining simple, coarse 3D geometries, known as “base meshes.” In general, each base mesh is a collection of triangle faces, in which trios of adjacent points, or vertices, are connected to form an approximation of a 3D surface. This approximation represents a coarse approximation of a more complex, ideal 3D surface, known as a “limit subdivision surface,” or “limit surface.” 
     A computer creates an initial “subdivision surface” from a base mesh by applying a computational kernel, known as a “subdivision kernel,” to the triangles and vertices in the base mesh. Repeated and recursive application of the subdivision kernel yields increasingly smooth meshes that converge at the limit surface as the number of iterations approaches infinity. 
     Producing a subdivision surface typically involves computing a weighted midpoint between each pair of vertices in each triangle (i.e., along each edge in the mesh) and then connecting the midpoints, or “tessellating” the triangle, to create four smaller triangles. The time required to subdivide a 3D surface mesh depends upon the technique used in tessellating the triangles in the mesh. More efficient tessellation techniques reduce processing time and therefore improve rendering speed. 
     In rendering 3D surfaces, computers must often calculate surface normal vectors to ensure realistic light shading of the surfaces. Simple lighting models use the angle between a surface normal vector and a vector in the direction of the light source to calculate how much light strikes the surface at a corresponding vertex. In general, the computer must compute a surface normal vector for each new vertex produced in the subdivision surface computations. As with tessellation, more efficient surface normal calculation reduces processing time and therefore improves rendering speed. 
     SUMMARY 
     In rendering an image of a 3D surface, a computer system obtains a digital model that includes data points defining vertices for triangles that represent 2D faces of the 3D surface. The computer also obtains a plurality of vectors, each defining a surface normal for the 3D surface at a corresponding one of the vertices. The computer applies an algorithm, such as a Butterfly Subdivision Scheme, to the data points to create new data points defining new vertices that subdivide the triangles into smaller triangles. The computer applies the same algorithm to the vectors to calculate new vectors, each defining a surface normal at a corresponding one of the new vertices. 
     Other embodiments and advantages will become apparent from the following description and from the claims. 
    
    
     DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram of a computer system. 
     FIG. 2 illustrates the Butterfly Subdivision Scheme. 
     FIG. 3 illustrates a technique for calculating surface normals when subdividing a 3D surface mesh. 
    
    
     DETAILED DESCRIPTION 
     The techniques described here are more computationally efficient that conventional surface normal calculation techniques. As described in detail below, these techniques are an order of magnitude more efficient, in terms of both floating point operations and processing cycles, than conventional surface normal calculation techniques. The described techniques also yield surface normal vectors that precisely follow the smoothness of the subdivision surfaces. These techniques lend themselves to efficient implementation with hardware components. A single set of gates can be used to perform both subdivision of the 3D surface mesh and surface normal calculation. 
     FIG. 1 shows a computer system  100  configured for use in 3D surface generating and rendering applications. The computer includes at least one central processor  105  that performs the operations necessary to generate and render 3D surfaces. In most systems, the processor  105  includes or has access to cache memory (not shown), which provides a temporary storage area for data accessed frequently by the processor  105 . The computer also includes system memory  110 , which stores program instructions and data needed by the processor  105 . System memory  110  often includes one or more volatile memory devices, such as dynamic random access memory (DRAM). A memory controller  115  governs the processor&#39;s access to system memory  110 . 
     The computer also includes various input and output components, such as a basic input/output system (BIOS)  120 , a CD-ROM or floppy disk drive  125 , and a hard disk drive  130 . A 3D graphics program  135 , such as a finite element analysis program or a cartography program loaded into the CD-ROM/floppy drive  125  or the hard drive  130 , provides program instructions for execution by the processor  105  in generating 3D images. The 3D graphics program  135  includes instructions for implementing a subdivision surface generator, which allows the processor  105  to create a refined 3D surface from a base mesh that represents a coarse approximation of a limit surface. A graphics controller  140  receives data representing the 3D surfaces from the processor and renders 3D images on a display device  145 , such as a cathode ray tube (CRT) display or a liquid crystal diode (LCD) display. 
     FIG. 2 illustrates one subdivision technique, known as the “Butterfly Subdivision Scheme,” for use by the subdivision surface generator in refining a 3D surface mesh. This technique involves defining a local neighborhood  200  for each edge  205  in the mesh at a k th  subdivision surface, where k=0 for the base mesh, and then calculating a midpoint (m k+1 ) along the edge. Each neighborhood  200  includes eight vertices (p 1   k -p 8   k ) defining six triangles arranged in a butterfly-shaped pattern. The computer applies a linear equation to the eight vertices in the neighborhood  200  to define the location of the midpoint m k+1  in the k+1 th  subdivision surface. In general, the computer repeats this process for every edge in the mesh. 
     In the example shown here, the computer subdivides the Is edge  205  defined by the vertices p 1   k  and p 2   k  according to the following equation: 
     
       
           m   k+1 =½( p   1   k   +p   2   k )+2 w ( p   3   k   +p   4   k )− w ( p   5   k   +p   6   k   +p   7   k   +p   8   k ), 
       
     
     where w is a constant, known as the “global tension parameter,” that controls the degree to which the subdivision kernel smoothes the surface. Therefore, the midpoint m k+1  represents a simple linear combination, in the form of a weighted average, of the vertices p 1   k -p 8   k  in the local neighborhood  200 . The weighting factors in the equation are selected to emphasize the vertex connectivity that most influences the local smoothness of the mesh at each midpoint. 
     The computer completes the k+1 th  subdivision surface by defining a butterfly-shaped neighborhood around each edge in the k th  subdivision surface, applying the equation above to each neighborhood to define a corresponding midpoint, and triangulating, or tessellating, the k th  subdivision surface by connecting the newly-defined midpoints. FIG. 3 shows a tessellated triangle  210 , in which the midpoints m 12   k+1 , m 13   k+1 , and m 13   k+1  between the pairs of vertices p 1   k -p 2   k , p 1   k -p 3   k , and p 2   k -p 3   k , respectively, are connected to create four smaller triangles  215 ,  220 ,  225 ,  230 . Using the Butterfly Subdivision Scheme to subdivide a 3D surface model is described in more detail in Dyn, N., Levin, D., and Gregory, J. A., “A Butterfly Subdivision Scheme for Surface Interpolation with Tension Control,” ACM Transactions on Graphics 9, 2 (1990). 
     FIG. 3 illustrates a technique for calculating surface normal vectors when subdividing a 3D surface mesh. This technique is useful, for example, in computing light shading effects for a rendered image of the 3D surface mesh. This technique involves using the same equation given above to calculate the surface normal vectors (n 1   k -n 8   k ) for each of the eight vertices in a butterfly-shaped neighborhood around an edge. In particular, the surface normal vector n k+1  for a subdivision midpoint m k+1  on a particular edge is calculated according to the following equation: 
     
       
           n   k+1 =½( n   1   k   +n   2   k )+2 w ( n   3   k   +n   4   k )− w ( n   5   k   +n   6   k   +n   7   k   +n   8   k ), 
       
     
     where w is the “global tension parameter” defined above. 
     Applying this equation in this manner accurately yields the surface normal vectors because each surface normal vector is an expression of surface smoothness at a particular vertex in the 3D surface mesh. Like the vertices, the surface normal vectors are defined as (X, Y, Z) vectors in three-dimensional space. In some implementations, the vertices of the subdivision surface and the corresponding surface normal vectors are computed simultaneously by inserting 6-dimensional vectors (X 1 , Y 1 , Z 1 , X 2 , Y 2 , Z 2 ) into the subdivision equation. This technique is even more efficient when the computer expresses the surface normals as vectors of unit length and defines the vectors in two-dimensional, spherical coordinates (φ,θ) Expressing the surface normals in spherical coordinates allows the use of 5-dimensional vectors in the equation above and thus further simplifies the computation. 
     Empirical evidence suggests that certain computers can calculate a surface normal vector using this butterfly subdivision technique in approximately 20 floating point operations, or 40 processing cycles. One conventional surface normal calculation technique involves calculating the cross-products of the normals of all triangles that share a vertex, and then averaging the cross-products to derive a surface normal for the vertex. This technique requires approximately 107 floating point operations, 6 square root operations, and 21 divide operations, for a total of approximately 1294 processing cycles. Another conventional technique involves performing an eigenanalysis of the subdivision kernel to yield two eigenvectors, and then multiplying these eigenvectors against a matrix representing the local vertex neighborhood. The resulting surface tangent vectors are then cross-multiplied to produce a surface normal vector for the midpoint. This technique requires approximately 224 floating point operations, one square root operation, and three divide operations, for a total of approximately 614 processing cycles. Therefore, in certain computers, the butterfly technique described here is more than 15 times more efficient than one of these conventional techniques and more than 30 times more efficient than the other of these conventional techniques. 
     A number of embodiments of the invention are described above. A person of ordinary skill will recognize that various modifications are possible without departing from the spirit and scope of the invention. For example, while the invention has been described in terms of the Butterfly Subdivision Scheme, it is useful with other subdivision schemes, such as Loop&#39;s scheme, as well. Moreover, while the invention has been described in terms of a programmable computer executing program instructions, other implementations are realized in discrete digital components, in application specific integrated circuits (ASICs), and in some combination of these technologies. Accordingly, other embodiments are within the scope of the following claims.