TESSELLATION OF A SURFACE BASED ON SLOPE

Abstract: A computer system (10) includes a display (14), a processor (12) and a memory (18). The memory stores a program (19) to cause the processor to determine a first rate at which a slope of a surface (40) changes near a first point (46a) of the surface and based on the determination, select a second point (46b) of the surface. The program (19) further causes the processor (12) to tessellate at least a portion the surface (40) based on the first and second points (46) to form at least one polygon and cause the display (14) to form said at least one polygon on the display to represent at least a portion of an image of the surface (40).

Description: TESSELLATION OF A SURFACE BASED ON SLOPE Background The invention relates to tessellation of a surface, such as a non-uniform rational b- spline (NURBS) surface, for example. Referring to Fig. 1 , a graphics system may use a mathematical function to describe a three dimensional (3-D) surface 5. For example, the graphics system may use a non-uniform rational b-spline (NURBS) surface function to derive points of the surface 5. The NURBS surface function is defined using elements called knots and control points. The control points are located off of the surface 5 and are used to approximate the general curvature of the surface 5. The knots are values that control whicn control points to use for a given region of the surface 5. Because the NURBS surface function is associated with a relatively small amount of data, the NURBS representation of a surface may be well suited for purposes of transmitting a representation of the surface 5 over a computer network having a low bandwidth, such as the Internet, for example. This small data size may also be of interest to developers that create highly detailed scenes. Although the NURBS surface function is associated with a small amount of data, the NURBS surface function may not be suited for purposes of rendering an image (of the surface 5) to be displayed by the system. Instead, for purposes of displaying an image of the surface 5, the graphics system may use a mesh of polygons to represent the surface 5, and the graphics system may use the NURBS surface function to subdivide the surface 5 into the polygons using a technique called tessellation. The end product of the tessellation typically is a set of vertices (of the polygons) that describe the locations of the polygons. In this manner, the graphics system may use the set of vertices to render an image of the surface 5. In the course of the tessellation, the graphics system may select a vertex by estimating an error between a polygon created with that vertex and the region of the surface that is represented by the polygon. If the error is unacceptable, then the graphics system may resize the polygon and repeat the error estimation. This process may continue until the polygon is appropriately sized. During the tessellation, the graphics system may modify the original NURBS surface function, such as by adding additional knots and control points to the original NURBS surface function, as an example. Unfortunately, the error estimation and the ongoing modification of the NURBS surface function may consume processing time of the system. As a result, the overhead incurred by the tessellation may limit the ability of the graphics system to rapidly display and manipulate images. Thus, there is a continuing need for an arrangement that expedites the tessellation of mathematically described surfaces. Summary In one embodiment, a method for forming an image of a surface on a display of a computer system includes determining a first rate at which a slope of the surface changes near a first point of the surface and based on the determination, selecting a second point of the surface. At least one polygon is formed based on the first and second points to form at least a portion of the image. The polygon(s) are displayed on the display. In another embodiment, an article includes a storage medium that is readable by a processor-based system. The storage medium stores instructions to cause a processor to determine a first rate at which a slope of a surface changes near a first point of the surface and based on the determination, select a second point of the surface. The storage medium stores instructions to cause the processor to tessellate at least a portion the surface based on the first and second points to form at least one polygon and cause the formation of said at least one polygon on a display to represent at least a portion of an image of the surface. In yet another embodiment, a computer system includes a display, a processor and a memory. The memory stores a program to cause the processor to determine a first rate at which a slope of a surface changes near a first point of the surface and based on the determination, select a second point of the surface. The program further causes the processor to tessellate at least a portion the surface based on the first and second points to form at least one polygon and cause the display to form said at least one polygon on the display to represent at least a portion of an image of the surface. Brief Description Of The Drawing Fig. 1 is a perspective view of a surface. Fig. 2 is a schematic diagram of a computer system according to an embodiment of the invention. Fig. 3 is a perspective view of a surface illustrating tessellation. Fig. 4 is an illustration of tessellation of surface by a processor of the computer system of Fig. 2. Figs. 5, 6 and 7 are flow diagrams illustrating execution of a tessellation program by the processor of Fig. 2 according to an embodiment of the invention. Detailed Description Referring to Fig. 2, an embodiment 10 of a computer system in accordance with the invention includes a system memory 18 that stores a tessellation program 19. In some embodiments, the tessellation program 19, when executed by a processor 12 (of the computer system 10), causes the processor 12 to tessellate a mathematically described surface 40 (see Fig. 3) to form a mesh of polygons that represents the surface 40. In this manner, the processor 12 selects a set of vertices of the polygons, and these vertices may be used for purposes of quickly rendering an image of the surface 40 on a display 14 of the computer system 10. As an example, the surface 40 may be a non-uniform, rational b-spline surface (NURBS). In the course of selecting each vertex, the processor 12 (when executing the program 19) takes into account the rate at which the slope of the surface 40 changes near that vertex. As described below, as a result of this technique, the processor 12 represents regions 42 (see Fig. 3) in which the slope of the surface 40 changes rapidly with smaller polygons and represents regions 43 in which the slope of the surface 40 remains nearly constant with larger polygons, as described below. In some embodiments, the processor 12 performs these functions without manipulating the mathematical function that describes the surface 40 and without estimating subdivision errors, techniques that typically consume processing power. Thus, the advantages of the above-described arrangement may include one or more of the following: tessellation processing times may be reduced; a mathematical function that describes the surface may not be altered; single-instruction-multiple-data (SIMD) instructions may be used; surfaces may be tessellated in real time; and over-tessellation may be avoided. In the context of this application, the phrase "computer system" may generally refer to a system that includes a processor and may include (but is not limited to) a graphics system, a desktop computer or a mobile computer (a laptop computer, for example), as just a few examples. The term "processor" may refer to, as examples, to at least one microcontroller, X86 microprocessor, Advanced RISC Machine (ARM) microprocessor or Pentium microprocessor. The examples given above are not intended to be limiting, but rather, other types of computer systems and other types of processors may be included in embodiments of the invention. Referring to Fig. 3, in some embodiments, the surface 40 may be described by a NURBS surface function (called S(u,v)) that is obtained by mapping a bounded two- dimensional parameter space (u,v) into a set of points that describes the surface 40. The S(u,v) surface function is described below: where P, j represents an m x n array of control points that control the curvature of the surface 40; w, j are control point weights; and B 1?p (u) and B j q (v) are b-spline basis functions defined by the Cox-DeBoor recurrence formula over the following knot vectors called U and V: U={u 0 , u„ u 2 , u p , . . ., u m+p _ 2 , u ra+ , u m+p } and V={v 0 , v„ v 2 , v q , . . ., v n+q _ 2 , v n+q .„ v n+q } The B-spline basis functions are described below: B l 0 (u) = l,if u λ ≤ u < u l+l B l 0 (u) = 0, otherwise U — U U , n + \ ~ U B, p (u) = '-B,^ (u) + ^^ B ιw (u) u ι+p — u i u ι+p+ ,\ — u i+ ,l The S(u,v) surface function is defined to be valid over the closed knot range from (u MIN ,v MIN ) to (u MAX , v MAX ). The x,y,z and homogenous w components of the S(u,v) surface function, denoted by S x , S y , S z and S w , respectively, are described by the following equations: SΛu,v) = ∑∑B, p (u)B J p (v) Wι / P X ι (=0 ;=0 S y ^) = ∑∑B, u)B j q v) Wl J P 2ι j 1=0 7=0 In the following description, partial derivatives are designated using superscripts. For example: dS(u,v) d f dS(u,v) S"and ≡ S V du dv dv Referring to Fig. 4, in some embodiments, the polygons may be triangles 44, and the processor 12 may select the vertices of the triangles 44 based on first and second partial derivatives of the S(u,v) surface function. For example, the processor 12 may select a particular vertex 46a and then, using the S(u,v) surface function, calculate the rate of change of the slope of the surface 40 at the vertex 46a with respect to either the parameter u or v. For example, the processor 12 may hold the u parameter constant and advance along a v- parametric curve 48 to select the next vertex 46b (after the vertex 46a) by incrementing the value of the v parameter. In this manner, the processor 12 may calculate the S vv second partial derivative at the vertex 46a and from this calculation, determine an amount by which to increase the v parameter. After the processor 12 increases the v parameter by this amount, the processor 12 uses the S(u,v) surface function (with the new v parameter) to determine the next vertex 48b. Similarly, in the course of determining the vertices, the processor 12 may hold the v parameter constant and advance along the resulting u-parametric curve by changing the u parameter in manner similar to the technique described above. In this manner, the processor 12 may calculate the S uu partial derivative at each vertex and advance along the v-parametric curve based on the calculation. In general, if the second partial derivative (S vv or S uu ) is approximately equal to zero, the processor 12 may advance the parameter (u or v) by a large value to set a relatively large distance between adjacent vertices, as the slope of the surface 40 changes by a relatively small amount between the vertices. However, if the second partial derivative is changing by a significant amount, then the processor 12 may advance the parameter by a small value to minimize the distance between adjacent vertices, as the slope of the surface 40 is changing more rapidly. The processor 12 may also advance the parameter by a small amount in the neighborhood of curvature discontinuities (as indicated by the first and second partial derivatives of the S(u,v) surface function), as further described below. In some embodiments, without curvature discontinuities, the processor 12 generally sets the advancement of the u or v parameter to be inversely proportional to the absolute value of the partial second derivative of the S(u,v) surface function with respect to that parameter. However, other arrangements are possible. For example, the parameter may be advanced according to a schedule of values. In this manner, the larger values of the schedule may be associated with second partial derivatives having smaller magnitudes, and the smaller values of the schedule may be associated with second partial derivatives having larger magnitudes. As an example, the program 19 may cause the processor 12 to select vertices of the polygon mesh in the following manner. Starting with the minimum boundary value for the u parameter (called u MIN ), the processor 12 advances the v parameter from v min (the minimum boundary value for the v parameter) to v max (the maximum boundary value for the v parameter) along a v-parametric curve. Each advancement of the v parameter produces a selected vertex, and the processor 12 advances to the next selected vertex based on the value of the S vv partial derivative at the last selected vertex. The processor 12 then advances the u parameter based on the S uu partial derivative and repeats the above-described process to select more vertices. When the processor 12 determines that the u parameter has reached u max (the maximum boundary value for the u parameter), the selection of the vertices (and the tessellation of the surface 40) is complete. Referring to Fig. 5, more particularly, upon execution of the program 19, the processor 12 may initially set the u (block 50) and v (block 52) parameters to their minimum U na ,, and v min boundary values. Next, the processor 12 may determine (diamond 54) whether the u parameter is less than or equal to u max . If not, the tessellation is complete, and the processor 12 may terminate execution of the program 19. Otherwise, the processor 12 determines (diamond 56) whether the v parameter is less than or equal to v max , i.e., the processor 12 determines whether it is time to advance the u parameter. If the v parameter is less than or equal to v min , the processor 12 determines (block 58) the first (S v ) and second (S vv ) partial derivatives at the current point (u,v) and adds (block 60) the current point (given by the S x (u,v), S γ (u,v) and S z (u,v) functions) to the set of selected vertices. Next, the processor 12 determines an amount (called v DELTA ) in which to increase the v parameter. Referring to Fig. 6, in this manner, if the processor 12 determines (diamond 62) that the second partial derivative (S vv ) is approximately equal to zero, then the processor 12 subsequently determines (diamond 66) whether the first partial derivative (S v ) is approximately equal to zero. If both the first (S v ) and second (S vv ) partial derivatives are equal to zero, then the processor 12 may assume that the surface 40 is substantially planar with respect to the v parameter near the current point given by the u and v parameters. If this is the case, then the processor 12 may set v DELTA to a relatively large value. For example, the processor 12 may advance v DELTA proportionally to the difference between the two NURBS knots that are located on both sides of the v parameter. In this manner, the processor 12 may set (block 70) v DELTA equal to: q. where v KN0T < V < V KNOT+1 . If the processor 12 determines (diamond 66) that the first partial derivative (S v ) is not approximately equal to zero (but the second partial derivative S vv is approximately equal to zero as determined in diamond 62), a condition that indicates a discontinuity in the curvature of the surface 40, then the processor 12 sets v DELTA to a small predetermined value (called EPSILON). If the processor 12 determines (diamond 62) that the S vv second partial derivative is not approximately equal to zero, then the processor 12 sets (block 64) v DELTA to be inversely proportional to the absolute value of the S vv second partial derivative. After the processor 12 determines the value for v DELTA , the processor 12 sets (block 72) the new value for the v parameter equal to the summation of the current value for the v parameter and v DELTA . However, if the processor 12 determines (diamond 74) that the new value of the v parameter is greater than the value of the v KN0T+1 knot value, then the processor 12 sets (block 76) the new value equal to the v KN0T+ ι value. Referring back to Fig. 5, the processor 12 subsequently determines (diamond 56) if the value for the v parameter exceeds v MAX . If not, the processor 12 continues to perform the functions associated with the constant u, as described above. However, if so, the processor 12 determines an amount (called u DELTA ) in which to increase the value of the u parameter. In this manner, referring to Fig. 7, the processor 12 determines (block 77) the S u and S uu partial derivatives. In some embodiments, in this determination, the processor 12 may evaluate the S u and S uu partial derivatives at the last selected value of v along the last v parametric curve, as an example. However, other selected values of v may be used for this evaluation. In some embodiments, the processor 12 may evaluate the S u and S uu partial derivatives for each selected value of v along the last v parametric curve and choose the smallest u advancement based on the results, as further described below; however, for purposes of describing the flow illustrated in Fig. 7, it is assumed that the processor 12 evaluates one S u partial derivative and one S uu partial derivative at a selected v value to determine the u advancement. If the processor 12 determines (diamond 78) that the S uu second partial derivative is approximately equal to zero, then the processor 12 subsequently determines (diamond 82) whether the S u first partial derivative is approximately equal to zero. If both the first (S u ) and second (S uu ) partial derivatives are equal to zero, then the processor 12 may assume that the surface 40 is substantially planar with respect to the u parameter near the current point given by the u and v parameters. If this is the case, then the processor 12 may set u DELTA to a relatively large value. For example, the processor 12 may set u DELTA to proportionally the difference between the two knots that are located on both sides of u. In this manner, the processor 12 may set (block 86) u DELTA equal to: U KNOT+\ ~ U KΗOT P where u KN0T < < u KN0T+1 . If the processor 12 determines (diamond 82) that the S u first partial derivative is not approximately equal to zero (but the S uu second partial derivative is approximately equal to zero), a condition that indicates a discontinuity in the curvature of the surface 40, then the processor 12 sets u DELTA to EPSILON. If the processor 12 determines (diamond 78) that the S uu second partial derivative is not approximately equal to zero, then the processor 12 sets (block 80) u DELTA to be inversely proportional to the absolute value of the S uu second partial derivative. After the processor 12 determines the new u DELTA , the processor 12 then sets (block 88) the new value for the u parameter equal to the summation of the current value for the u parameter and u DELTA . However, if the processor 12 determines (diamond 90) that the new value for the u parameter is greater than the value of the u KN0T+1 knot value, then the processor 12 sets (block 92) the new value equal to the u KN0T+ι value. The processor 12 subsequently returns to diamond 54, as depicted in Fig. 5. Referring back to Fig. 2, in some embodiments, the computer system 10 may include a bridge, or memory hub 16. The processor 12 and the memory hub 16 may be coupled to a host bus 14. The memory hub 16 may provide interfaces to couple the host bus 14, a memory bus 29 and an Accelerated Graphics Port (AGP) bus 11 together. The AGP is described in detail in the Accelerated Graphics Port Interface Specification, Revision 1.0, published on July 31, 1996, by Intel Corporation of Santa Clara, California. The system memory 18 may be coupled to the memory bus 29, and a display controller 13 (that controls the display 14) may be coupled to the AGP bus 11. A hub communication link 15 may couple the memory hub 16 to another bridge circuit, or input/output (I/O) hub 20. In some embodiments, the I/O hub 20 includes interfaces to an I/O expansion bus 25 and a Peripheral Component Interconnect (PCI) bus 21. The PCI Specification is available from The PCI Special Interest Group, Portland, Oregon 97214. The I/O hub 20 may also include interfaces to a hard disk drive 32 and a CD-ROM drive 33, as examples. An I/O controller 17 may be coupled to the I/O expansion bus 25 and receive input data from a keyboard 24 and a mouse 26, as examples. The I/O controller 17 may also control operations of a floppy disk drive 22. Copies of the program 19 may be stored on, as examples, the hard disk drive 32, a diskette or a CD-ROM, as just a few examples. Other embodiments are within the scope of the following claims. For example, in the execution of the above-described tessellation program 19, the processor 12 determines advances for the u and v parameters separately by evaluating the S v and S" partial derivatives along each v parametric curve to determine the v advancements and subsequently determining the S u and S uu partial derivatives to determine the u advancement before advancing along the next v parametric curve. However, alternatively, the processor 12 may determine the parametric advancements by evaluating the S vv , S v , S u , and S uu partial derivatives together. For example, in some embodiments, in the "v-parameter loop" (i.e., blocks and diamonds 58-76 of Figs. 5 and 6), the processor 12 may calculate the S uu and S u partial derivatives for each selected value of v along the particular v parametric curve, and from these partial derivatives, the processor 12 may determine different amounts in which to advance the u parameter for the next v-parameter loop. In this manner, when the processor 12 completes the advancement along the particular v parametric curve, the processor 12 may choose the smallest (as an example) advancement (from the calculated u advancements) by which to advance the u parameter before advancing along the next v parametric curve. As other examples, the above-described techniques may be applied to select points of the polygons other than vertices of the polygons. The above-described techniques may also be applied to the tessellation of volumes. The polygons may be polygons other than triangles. While the invention has been disclosed with respect to a limited number of embodiments, those skilled in the art, having the benefit of this disclosure, will appreciate numerous modifications and variations therefrom. It is intended that the appended claims cover all such modifications and variations as fall within the true spirit and scope of the invention. What is claimed is:

Claims: 1. A method for forming an image of a surface on a display of a computer system, comprising: determining a first rate at which a slope of the surface changes near a first point of the surface; based on the determination, selecting a second point of the surface; forming at least one polygon based on the first and second points to form at least a portion of the image; and displaying said at least one polygon on the display. 2. The method of claim 1 , wherein the act of determining comprises: determining a partial derivative of a mathematical function that describes the surface. The method of claim 2, wherein the mathematical function comprises: a non-uniform rational b-spline surface function. 4. The method of claim 1, wherein the act of selecting comprises: advancing a distance from the first point to the second point; and regulating the distance based on the first rate. The method of claim 4, wherein the act of regulating comprises: downwardly adjusting the distance when the first rate has a larger value; and upwardly adjusting the distance when the first rate has a smaller value. 6. The method of claim 4, wherein the act of regulating comprises: causing the distance to be inversely proportional to the first rate. 7. The method of claim 1 , wherein the act of forming said at least one polygon comprises: using the first and second points to form vertices of the polygon. 8. The method of claim 1, further comprising: determining a second rate at which a slope of the surface changes near the second point of the surface; based on the determination, selecting a third point of the surface; and using the third point in the formation of said at least one polygon. 9. The method of claim 1, further comprising: determining other rates at which slopes of the surface change near other points of the surface; using the other rates to select additional points of the surface; and using the additional parts to form additional polygons. 10. An article comprising a storage medium readable by a processor-based system, the storage medium storing instructions to cause a processor to: determine a first rate at which a slope of a surface changes near a first point of the surface, based on the determination, select a second point of the surface, tessellate at least a portion the surface based on the first and second points to form at least one polygon, and cause the formation of said at least one polygon on a display to represent at least a portion of an image of the surface. 11. The article of claim 10, the storage medium storing instructions to cause the processor to determine a partial derivative of a mathematical function that describes the surface. 12. The article of claim 11, wherein the mathematical function comprises: a non-uniform rational b-spline surface function. 13. The article of claim 10, the storage medium storing instructions to cause the processor to: advance a distance from the first point to the second point, and regulate the distance based on the first rate. 14. The article of claim 13, the storage medium storing instructions to cause the processor to: downwardly adjust the distance when the first rate has a larger value, and upwardly adjust the distance when the first rate has a smaller value. 15. The article of claim 13, the storage medium storing instructions to cause the processor to: cause the distance to be inversely proportional to the first rate. 16. The article of claim 10, the storage medium storing instructions to cause the processor to: use the first and second points to form vertices of the polygon. 17. The article of claim 10, the storage medium storing instructions to cause the processor to: determine a second rate at which a slope of the surface changes near the second point of the surface, based on the determination, select a third point of the surface, and use the third point in the formation of said at least one polygon. 18. The article of claim 10, the storage medium storing instructions to cause the processor to: determine other rates at which slopes of the surface change near other points of the surface, use the other rates to select additional points of the surface; and use the additional points to form additional polygons. 19. A computer system comprising: a display; a processor; and a memory storing a program to cause the processor to: determine a first rate at which a slope of a surface changes near a first point of the surface, based on the determination, select a second point of the surface, tessellate at least a portion the surface based on the first and second points to form at least one polygon, and cause the display to form said at least one polygon on the display to represent at least a portion of an image of the surface. 20. The computer system of claim 19, wherein the processor is adapted to determine the first rate by determining a partial derivative of a mathematical function that describes the surface.

Inventors: MACRI DEAN, MACRI, DEAN
Applicants: INTEL CORP, MACRI DEAN, INTEL CORPORATION, MACRI, DEAN
Application year: 1999
Main classification: G06T17
IPC codes: G06T17