This application is related to, and incorporates by reference, the following commonly assigned U.S. Patent Applications:
A METHOD AND SYSTEM FOR RENDERING POLYGONS HAVING ABUTTING EDGES, by Crow et al., filed on Dec. 19, 2005, Ser. No. 11/312,962, and A METHOD AND SYSTEM OR RENDERING POLYGONS WITH A BOUNDING BOX IN A GRAPHICS PROCESSOR UNIT, by Crow, F., filed on Dec. 19, 2005, Ser. No. 11/312,919.
The present invention is generally related to hardware accelerated graphics computer systems.
Embodiments of the present invention provide a method and system for rendering polygons having abutting edges. Embodiments of the present invention provide fast and efficient real-time 3-D graphics rendering while ensuring foreground objects are properly anti-aliased against a background in order to preserve image quality.
In one embodiment, the present invention is implemented as a method for rendering adjacent polygons in a GPU. The method includes determining when a first polygon and a second polygon have an abutting edge (e.g., as in a case where multiple polygons are used to construct an object). If an abutting edge exists, a majority status is assigned to a pixel on the abutting edge. A first color of the first polygon or a second color of the second polygon is then allocated to the pixel in accordance with the majority status. In a typical implementation, at least one edge of the first polygon or the second polygon other than the abutting edge is anti-aliased with respect to a background color. The present embodiment saves the cost of the unnecessary blending operations by use of the majority status. The majority status can be determined by determining whether the first polygon or the second polygon covers a center of the pixel.
In one embodiment the abutting edge is determined by detecting when the first polygon and the second polygon have common vertices. Alternatively, the abutting edge can be determined by parsing a list of vertices describing a plurality of polygons (e.g., triangle strip, etc.), or by detecting a winged edged polyhedron.
Embodiments of the present invention provide a method and system for rendering polygons having abutting edges. Embodiments of the present invention provide fast and efficient real-time 3-D graphics rendering while ensuring foreground objects are properly anti-aliased against a background in order to preserve image quality.
In one embodiment, the present invention is implemented as a method for rendering a plurality of line primitives. The method includes the step of accessing a first line primitive and a second line primitive (e.g., line segments) of a line strip. For a junction between the first line primitive and the second line primitive, the first line primitive and the second line primitive are geometrically modified to generate an abutting edge between the first line primitive and the second line primitive. A majority status is assigned to a pixel on the abutting edge. A first color of the first line primitive or a second color of the second line primitive is allocated to the pixel in accordance with the majority status. In a typical implementation, at least one edge of the first line primitive or the second line primitive other than the abutting edge is anti-aliased with respect to a background color, and the abutting edge is configured to provide a continuous join between the first line primitive and the second line primitive. For example, one improvement is that the line segments no longer have a sequential read modify write dependency when being blended into the frame buffer. The blending can be done independently for each segment, thereby improving the performance of the system.
In one embodiment, an angle of the abutting edge is computed by summing respective direction vectors of the first line primitive and the second line primitive. In one embodiment, a plurality of line primitives between the first line primitive and the second line primitive and that do not exit the pixel can be accumulated to prevent multiple writes to the pixel. In one embodiment, a sub-pixel bounding box is used to crop the first line primitive and the second line primitive. Alternatively, a line rotated to a right angle to the abutting edge can be used to crop the first line primitive and the second line primitive.
The present invention is illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which like reference numerals refer to similar elements.
Reference will now be made in detail to the preferred embodiments of the present invention, examples of which are illustrated in the accompanying drawings. While the invention will be described in conjunction with the preferred embodiments, it will be understood that they are not intended to limit the invention to these embodiments. On the contrary, the invention is intended to cover alternatives, modifications and equivalents, which may be included within the spirit and scope of the invention as defined by the appended claims. Furthermore, in the following detailed description of embodiments of the present invention, numerous specific details are set forth in order to provide a thorough understanding of the present invention. However, it will be recognized by one of ordinary skill in the art that the present invention may be practiced without these specific details. In other instances, well-known methods, procedures, components, and circuits have not been described in detail as not to unnecessarily obscure aspects of the embodiments of the present invention.
Notation and Nomenclature:
Some portions of the detailed descriptions, which follow, are presented in terms of procedures, steps, logic blocks, processing, and other symbolic representations of operations on data bits within a computer memory. These descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. A procedure, computer executed step, logic block, process, etc., is here, and generally, conceived to be a self-consistent sequence of steps or instructions leading to a desired result. The steps are those requiring physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared, and otherwise manipulated in a computer system. It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, or the like.
It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the following discussions, it is appreciated that throughout the present invention, discussions utilizing terms such as “processing” or “accessing” or “executing” or “storing” or “rendering” or the like, refer to the action and processes of a computer system (e.g., computer system 100 of
Computer System Platform:
It should be appreciated that the GPU 110 can be implemented as a discrete component, a discrete graphics card designed to couple to the computer system 100 via a connector (e.g., AGP slot, PCI-Express slot, etc.), a discrete integrated circuit die (e.g., mounted directly on a motherboard), or as an integrated GPU included within the integrated circuit die of a computer system chipset component (not shown). Additionally, a local graphics memory can be included for the GPU 110 for high bandwidth graphics data storage.
Embodiments of the present invention can utilize a number of different techniques to determine when adjacent polygons share a common edge. As shown in
In one embodiment, the present invention avoids multiple writes to the same pixel along the abutting edge 205 between the polygons 201 and 202 by choosing to write only those pixels whose center lies on the near side of the edge joining the triangle being rasterized to the adjacent triangle or line. One such pixel 230 is shown.
As depicted in
In the present embodiment, once a majority status is determined for the pixel 230, the color for the pixel 230 is allocated in accordance with the majority status. For example, since the polygon 202 covers the majority of the pixel 230, the color from the triangle 202 will be allocated to the pixel 230, as opposed to the color from the triangle 201. Since the color from triangle 202 is allocated to the pixel 230, the pixel 230 only needs to be written to once.
Thus, the assigning of the majority status is configured to prevent multiple writes to the pixel 230 from the two polygons 202-203 and to prevent any blending of the colors of the two polygons to those pixels along the abutting edge 205. Additionally, since the color of the pixel 230 is allocated in accordance with the majority status, any blending of the background color along the abutting edge 205 is prevented, thereby preventing any background blended color appearing through the interior of a multi-triangle object. This feature eliminates a major source of rendering defects and artifacts common with prior art anti-aliasing techniques.
In this manner, embodiments of the present invention avoid having to blend colors from the adjacent polygons 201-202 while rendering pixels along their abutting edge 205 (e.g., pixel 230). However, it should be noted that image quality is maintained since anti-aliasing is performed on the other non-abutting edges (e.g., the outside edges). For example, the pixels along the other non-abutting edges have their colors blended with respect to a background color in accordance with their degree of coverage by the polygons 201-202. Anti-aliasing along internal abutting edges typically does not need to be performed since the abutting adjacent triangles are usually the same, or very close to the same, color. For example, in a triangle strip, common vertices defining abutting edges usually have the same color. This method does not apply when colors on opposite sides of the common edge are intended to be significantly different.
Process 500 begins in step 501, where the GPU 110 determines when a first polygon and a second polygon have an abutting edge. In step 502, as described above, a majority status is assigned to each of the pixels along the abutting edge. In step 503, the color is allocated from the first polygon or the second polygon to each of the pixels on the abutting edge. As described above, this color is allocated in accordance with the respective majority status for each of the pixels. In step 504, the outside edges of the polygons are anti-aliased with respect to any background colors. In this manner, the outside edges of the polygons are anti-aliased while preventing any background blend through on any of the interior abutting edges, and while preventing unnecessary multiple reads or writes to the same pixel.
As shown in
Embodiments of the present invention solve this problem by calculating a common slope for the intersection between adjacent line segments to replace the rectangular end with a generated, geometrically modified, abutting end. It should be noted that end-caps are not Illustrated in
In one embodiment, a majority status is assigned to a pixel on the abutting edge in the same manner as described above with the rendering of adjacent polygons that share a common abutting edge. A first color of the first line primitive or a second color of the second line primitive is allocated to the pixel in accordance with the majority status, wherein the majority status is determined by, for example, determining whether the first line primitive or the second line primitive covers a center of the pixel.
Referring now to
It should be noted that as with the rendering of adjacent polygons having a common abutting edge, at least one edge of the first line primitive or the second line primitive other than the abutting edge is anti-aliased with respect to a background color, and the abutting edge is configured to provide a continuous join between the first line primitive and the second line primitive. Additionally, it should be noted that in the present embodiment, the functionality of the present invention is implemented within the hardware and software of the rasterizer unit 402, shown in
Referring still to
Referring to
A sub-pixel bounding rectangle (e.g., bounding rectangle 1511) can be useful for solving some difficult rasterization problems. As described above, when rasterizing mitered lines, lines joining at acute angles protrude outward farther than they should. A sub-pixel bounding box can be used to limit their protrusion extent smoothly during real-time rendering so that no sudden changes of shading can be seen when such joins are moving around the screen 1500. Additionally, it should be noted that in the present embodiment, the bounding rectangle functionality of the present invention is implemented within the hardware and software of the rasterizer unit 402, shown in
The foregoing descriptions of specific embodiments of the present invention have been presented for purposes of illustration and description. They are not intended to be exhaustive or to limit the invention to the precise forms disclosed, and many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and its practical application, to thereby enable others skilled in the art to best utilize the invention and various embodiments with various modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the claims appended hereto and their equivalents.
Number | Name | Date | Kind |
---|---|---|---|
4208810 | Rohner et al. | Jun 1980 | A |
4918626 | Watkins et al. | Apr 1990 | A |
5081594 | Horsley | Jan 1992 | A |
5287438 | Kelleher | Feb 1994 | A |
5313287 | Barton | May 1994 | A |
5432898 | Curb et al. | Jul 1995 | A |
5446836 | Lentz et al. | Aug 1995 | A |
5452104 | Lee | Sep 1995 | A |
5452412 | Johnson et al. | Sep 1995 | A |
5483258 | Cornett et al. | Jan 1996 | A |
5543935 | Harrington | Aug 1996 | A |
5570463 | Dao | Oct 1996 | A |
5594854 | Baldwin et al. | Jan 1997 | A |
5623692 | Priem et al. | Apr 1997 | A |
5664162 | Dye | Sep 1997 | A |
5815162 | Levine | Sep 1998 | A |
5854631 | Akeley et al. | Dec 1998 | A |
5854637 | Sturges | Dec 1998 | A |
5872902 | Kuchkuda et al. | Feb 1999 | A |
5977987 | Duluk, Jr. | Nov 1999 | A |
6028608 | Jenkins | Feb 2000 | A |
6034699 | Wong et al. | Mar 2000 | A |
6072500 | Foran et al. | Jun 2000 | A |
6104407 | Aleksic et al. | Aug 2000 | A |
6104417 | Nielsen et al. | Aug 2000 | A |
6115049 | Winner et al. | Sep 2000 | A |
6118394 | Onaya | Sep 2000 | A |
6128000 | Jouppi et al. | Oct 2000 | A |
6137918 | Harrington et al. | Oct 2000 | A |
6160557 | Narayanaswami | Dec 2000 | A |
6160559 | Omtzigt | Dec 2000 | A |
6188394 | Morein et al. | Feb 2001 | B1 |
6201545 | Wong et al. | Mar 2001 | B1 |
6204859 | Jouppi et al. | Mar 2001 | B1 |
6219070 | Baker et al. | Apr 2001 | B1 |
6249853 | Porterfield | Jun 2001 | B1 |
6259460 | Gossett et al. | Jul 2001 | B1 |
6323874 | Gossett | Nov 2001 | B1 |
6359623 | Larson | Mar 2002 | B1 |
6362819 | Dalal et al. | Mar 2002 | B1 |
6366289 | Johns | Apr 2002 | B1 |
6429877 | Stroyan | Aug 2002 | B1 |
6437780 | Baltaretu et al. | Aug 2002 | B1 |
6452595 | Montrym et al. | Sep 2002 | B1 |
6469707 | Voorhies | Oct 2002 | B1 |
6480205 | Greene et al. | Nov 2002 | B1 |
6501564 | Schramm et al. | Dec 2002 | B1 |
6504542 | Voorhies et al. | Jan 2003 | B1 |
6522329 | Ihara et al. | Feb 2003 | B1 |
6525737 | Duluk, Jr. et al. | Feb 2003 | B1 |
6529207 | Landau et al. | Mar 2003 | B1 |
6606093 | Gossett et al. | Aug 2003 | B1 |
6611272 | Hussain et al. | Aug 2003 | B1 |
6614444 | Duluk, Jr. et al. | Sep 2003 | B1 |
6614448 | Garlick et al. | Sep 2003 | B1 |
6624823 | Deering | Sep 2003 | B2 |
6633197 | Sutardja | Oct 2003 | B1 |
6633297 | McCormack et al. | Oct 2003 | B2 |
6646639 | Greene et al. | Nov 2003 | B1 |
6671000 | Cloutier | Dec 2003 | B1 |
6693637 | Koneru et al. | Feb 2004 | B2 |
6693639 | Duluk, Jr. et al. | Feb 2004 | B2 |
6697063 | Zhu | Feb 2004 | B1 |
6717576 | Duluk et al. | Apr 2004 | B1 |
6717578 | Deering | Apr 2004 | B1 |
6734861 | Van Dyke et al. | May 2004 | B1 |
6741247 | Fenney | May 2004 | B1 |
6765575 | Voorhies et al. | Jul 2004 | B1 |
6778177 | Furtner | Aug 2004 | B1 |
6788301 | Thrasher | Sep 2004 | B2 |
6798410 | Redshaw et al. | Sep 2004 | B1 |
6803916 | Ramani et al. | Oct 2004 | B2 |
6819332 | Baldwin | Nov 2004 | B2 |
6833835 | van Vugt | Dec 2004 | B1 |
6906716 | Moreton et al. | Jun 2005 | B2 |
6938176 | Alben et al. | Aug 2005 | B1 |
6940514 | Wasserman et al. | Sep 2005 | B1 |
6947057 | Nelson et al. | Sep 2005 | B2 |
6956579 | Diard et al. | Oct 2005 | B1 |
6961057 | Van Dyke et al. | Nov 2005 | B1 |
6978317 | Anantha et al. | Dec 2005 | B2 |
7002591 | Leather et al. | Feb 2006 | B1 |
7009607 | Lindholm et al. | Mar 2006 | B2 |
7009615 | Kilgard et al. | Mar 2006 | B1 |
7061495 | Leather | Jun 2006 | B1 |
7064771 | Jouppi et al. | Jun 2006 | B1 |
7075542 | Leather | Jul 2006 | B1 |
7081902 | Crow et al. | Jul 2006 | B1 |
7119809 | McCabe | Oct 2006 | B1 |
7126600 | Fowler et al. | Oct 2006 | B1 |
7154066 | Talwar et al. | Dec 2006 | B2 |
7158148 | Toji et al. | Jan 2007 | B2 |
7170515 | Zhu | Jan 2007 | B1 |
7184040 | Tzvetkov | Feb 2007 | B1 |
7224364 | Yue et al. | May 2007 | B1 |
7307628 | Goodman et al. | Dec 2007 | B1 |
7307638 | Leather et al. | Dec 2007 | B2 |
7382368 | Molnar et al. | Jun 2008 | B1 |
7453466 | Hux et al. | Nov 2008 | B2 |
7483029 | Crow et al. | Jan 2009 | B2 |
7548996 | Baker et al. | Jun 2009 | B2 |
7551174 | Iourcha et al. | Jun 2009 | B2 |
7633506 | Leather et al. | Dec 2009 | B1 |
7634637 | Lindholm et al. | Dec 2009 | B1 |
7791617 | Crow et al. | Sep 2010 | B2 |
7965902 | Zelinka et al. | Jun 2011 | B1 |
8063903 | Vignon et al. | Nov 2011 | B2 |
20010005209 | Lindholm et al. | Jun 2001 | A1 |
20020050979 | Oberoi et al. | May 2002 | A1 |
20020097241 | McCormack et al. | Jul 2002 | A1 |
20020130863 | Baldwin | Sep 2002 | A1 |
20020140655 | Liang et al. | Oct 2002 | A1 |
20020158885 | Brokenshire et al. | Oct 2002 | A1 |
20020196251 | Duluk, Jr. et al. | Dec 2002 | A1 |
20030067468 | Duluk, Jr. et al. | Apr 2003 | A1 |
20030076325 | Thrasher | Apr 2003 | A1 |
20030122815 | Deering | Jul 2003 | A1 |
20030163589 | Bunce et al. | Aug 2003 | A1 |
20030194116 | Wong et al. | Oct 2003 | A1 |
20030201994 | Taylor et al. | Oct 2003 | A1 |
20040085313 | Moreton et al. | May 2004 | A1 |
20040130552 | Duluk, Jr. et al. | Jul 2004 | A1 |
20040183801 | Deering | Sep 2004 | A1 |
20040196285 | Rice et al. | Oct 2004 | A1 |
20040207642 | Crisu et al. | Oct 2004 | A1 |
20040246251 | Fenney et al. | Dec 2004 | A1 |
20050030314 | Dawson | Feb 2005 | A1 |
20050041037 | Dawson | Feb 2005 | A1 |
20050066148 | Luick | Mar 2005 | A1 |
20050122338 | Hong et al. | Jun 2005 | A1 |
20050134588 | Aila et al. | Jun 2005 | A1 |
20050134603 | Iourcha et al. | Jun 2005 | A1 |
20050179698 | Vijayakumar et al. | Aug 2005 | A1 |
20050259100 | Teruyama | Nov 2005 | A1 |
20060044317 | Bourd et al. | Mar 2006 | A1 |
20060170690 | Leather | Aug 2006 | A1 |
20060203005 | Hunter | Sep 2006 | A1 |
20060245001 | Lee et al. | Nov 2006 | A1 |
20060267981 | Naoi | Nov 2006 | A1 |
20070139440 | Crow et al. | Jun 2007 | A1 |
20070268298 | Alben et al. | Nov 2007 | A1 |
20070273689 | Tsao | Nov 2007 | A1 |
20070296725 | Steiner et al. | Dec 2007 | A1 |
20080024497 | Crow et al. | Jan 2008 | A1 |
20080024522 | Crow et al. | Jan 2008 | A1 |
20080100618 | Woo et al. | May 2008 | A1 |
20080273218 | Kitora et al. | Nov 2008 | A1 |
Number | Date | Country |
---|---|---|
101093578 | Dec 2007 | CN |
06180758 | Jun 1994 | JP |
10134198 | May 1998 | JP |
11195132 | Jul 1999 | JP |
2005182547 | Jul 2005 | JP |
0013145 | Mar 2000 | WO |
Entry |
---|
Fuchs; “Fast Spheres Shadow, Textures, Transparencies, and Image Enhancements in Pixel-Planes”; ACM; 1985; Department of Computer Science, University of North Carolina at Chapel Hill, Chapel Hill, NC 27514. |
A VLSI Architecture for Updating Raster-Scan Displays Satish Gupta, Robert F. Sproull, Ivan E. Sutherland Aug. 1981 ACM SIGGRAPH Computer Graphics, Proceedings of the 8th Annual Conference on Computer Graphics and Interactive Techniques SIGGRAPH '81, vol. 15 Issue Publisher: ACM Press. |
A Parallel Alogorithm for Polygon Rasterization Juan Pineda Jun. 1988 ACM. |
A Hardware Assisted Design Rule Check Architecture Larry Seiler Jan. 1982 Proceedings of the 19th Conference on Design Automation DAC '82 Publisher: IEEE Press. |
Boyer, et al.; “Discrete Analysis for Antialiased Lines;” Eurographics 2000; 3 Pages. |
Crow; “The Use of Grayscale for Improves Raster Display of Vectors and Characters;” University of Texas, Austin, Texas; Work supported by the National Science Foundation unser Grants MCS 76-83889; pp. 1-5: ACM Press ACM SIGGRAPH Computer Graphics vol. 12 Issue 3, Aug. 1978. |
Non-Final OA Dated Nov. 27, 2007; U.S. Appl. No. 11/304,904. |
Non-Final OA Dated May 1, 2007; U.S. Appl. No. 11/304,904. |
Office Action dated Feb. 2, 2005; U.S. Appl. No. 10/671,237. |
Office Action dated Aug. 22, 2005; U.S. Appl. No. 10/671,237. |
Advisory Action dated Nov. 29, 2005; U.S. Appl. No. 10/671,237. |
Notice of Allowance dated Apr. 4, 2006; U.S. Appl. No. 10/671,237. |
Blythe, OpenGL section 3.4.1, Basic Line Segment Rasterization, Mar. 29, 1997, pp. 1-3. |
Foley, J. “Computer Graphics: Principles and Practice”, 1987, Addison-Wesley Publishing, 2nd Edition, p. 545-546. |