1. Field of Invention
The present invention relates to real time computer graphics, and more particularly to a rasterizer design in 3D graphics hardware architecture.
2. Description of Related Arts
In computer graphics, the algorithms of primitive rasterizer can be broadly divided into two categories: namely immediate mode rendering algorithms and tile based rendering algorithms.
For the immediate mode rendering algorithm, as shown in
On the other hand, for the tile based rendering algorithm, as shown in
It is suggested that because the size of this tile is much smaller than the whole screen, the memory bandwidth that stores color buffer and Z buffer can be integrated into graphics chip. After all of the primitives of a particular tile are rendered, the color buffer and the Z buffer are subsequently written into local frame buffer. This saves memory access bandwidth for the color and Z.
After all tiles of a particular frame (the whole screen) have completed the pixel rendering process, the final image is sent to display unit which then displays the image in question to a user. It is suggested, this method is adapted for rapid hidden pixel removal and therefore saves processing time and memory resources.
Though these advantages, tile based rendering algorithm also has disadvantages. First, the primitives of the whole frame (screen) have to be stored into many tile buffers and are read many times since they are shared by multiple tiles. The duplicative primitives need a relatively big buffer to store and consumes considerable amount of memory bandwidths. Second, the use of tile based rendering algorithms involves repeated setup computations for each primitive when the primitive covers multiple tiles. Last, the primitive size of a frame is limited by the architecture of the tile based rendering algorithms.
A main object of the present invention is to provide a method of rendering a 3D graphic image using page based rendering technique, wherein each of the primitives is first divided adaptively into a plurality of segments which are processed in the same way as that of the tile based rendering technique, while the primitives of the whole frame are rendered in the same way as the immediate mode rendering technique, such that the page based rendering technique substantially integrates the advantages of both the immediate mode rendering technique and the tile based rendering technique, while resolving the respective disadvantages in associated with the these graphics rendering techniques.
Another object of the present invention is to provide a method of rendering a 3D graphics image using page based rendering technique, wherein the primitives are processed on-chip in a page-by-page basis, so that there is no need to repeatedly sort and store the primitives for the whole frame. Another object of the present invention is to provide a method of rendering a 3D graphics image using page based rendering technique, wherein the primitives are assigned into tiles and pre-sorted in a tile basis before they are shaded and textured, so as to avoid tile switch between primitives, such that the memory read and write efficiency can be maximized. In other words, the present invention provides an efficient and effective method for rendering a 3D graphics image.
In order to accomplish the above objects, the present invention provides a method of rendering a 3D graphics image, comprising the steps of:
(a) storing the primitive data of the incoming primitive into a on-chip memory and parameter data into another on-chip memory, the entries of the two memories form the ID of the primitive; (b) finding all the pages toughed by the primitive, the top-left coordinates of a page form the ID of the page;
(c) matching incoming page IDs of the incoming primitive with the page IDs stored in the page RAM, in such a manner that when the incoming page ID of the incoming primitive matches with the sorted page ID stored in the page RAM, the incoming primitive is stored at the corresponding page node under in the page RAM the corresponding page ID, wherein when the incoming page ID of the incoming primitive does not match with the sorted page ID, a new page node is created under the corresponding incoming page ID of the incoming primitive which is stored at the new page node; and
(d) flushing the page RAM when the free page nodes of the page RAM less than a predetermined amount or when the primitive's counter of one of page nodes reaches another predetermined number;
(e) rendering the primitives stored in the page into pixels of the page; and
(f) repeating steps a, b, c, d, e until all primitives of a frame are processed.
These and other objectives, features, and advantages of the present invention will become apparent from the following detailed description, the accompanying drawings, and the appended claims.
Referring to
Referring to
(a) storing the primitive data of the incoming primitive into the primitive bank 632 and parameter data into the parameter bank 634, the entries of the two banks form the ID of the primitive;
(b) finding all the pages toughed by the primitive, the top-left coordinates of a page form the ID of the page;
(c) matching incoming page IDs of the incoming primitive with the page IDs stored in the page RAM in such a manner that, when the incoming page ID of the incoming primitive matches with the sorted page ID stored in the page RAM, the incoming primitive is stored at the corresponding page node in the page RAM under the corresponding page ID, wherein when the incoming page ID of the incoming primitive does not match with the sorted page ID, a new page node is created under the corresponding incoming page ID of the incoming primitive which is stored at the new page node; and
(d) flushing the page RAM when the free page nodes of the page RAM less than a predetermined amount or when the primitive's counter of one of page nodes reaches another predetermined number; and
(e) rendering the primitives stored in the page into pixels of the page; and
(f) repeating steps a, b, c, d, e until all primitives of a frame are processed.
In the step (a), the operations of two banks are performed by a bank processing device comprising a primitive bank, a parameter bank and their control logics. The primitives are setup and the primitive data in
In the following steps, the sorting the primitives for each of the pages is performed by a page processing device comprising a page raster, a page sorting and a page RAM.
In the step (b), The primitive having a primitive ID are checked in methods of the prior art to find the pages that have pixels in the primitive. Each of the pages is designated by a page identification (ID) that is the top-left coordinates of the page.
In the step (c), the sorting the primitives for each of the pages is performed by a page sorting 614 and a page RAM 630. The sorting of the primitives ID and the pages ID are transferred to the page RAM 630 which is a one-chip memory, and stored as a predetermined page node. Page sorting engine 614 checks incoming primitives' ID with the ones stored in the page RAM 630. Where the incoming primitive's page ID matches with the relevant stored page IDs, the incoming primitive would be added to an existing node of the page RAM 630 under the same ID. Where the incoming primitive's page ID does not match with any page ID stored in the page RAM 630, a new page node would be created for storing that new primitive's page ID under the corresponding primitive ID.
In the step (d), when the memory resources of the page RAM 630 less than a predetermined amount, or when the primitive's counter of one of page nodes reaches a predetermined number, the page nodes, having the corresponding page IDs and the primitives stored under those page IDs, are sent to a next engine in the order they are created.
In the step (e), the rasterizer engine 618 that is attached to the page sorting 614 in the embodiment, receives page IDs and the primitive list from the page nodes and renders all the primitives of the page nodes into pixels in the way of the prior art.
Referring to
(e.1′) converting the primitives of the incoming page by the tile raster 1010 into tiles;
(e.2′) sorting the tiles in the tile sorting 1012 and storing the sorted tiles in a tile RAM 1014;
(e.3′) verifying the number of primitives for each of the tiles, in such a manner that when the number of primitives exceeds a predetermined number, this single tile is flushed into the interpolator engine 116, or when the last tile of the current page is met, all the tiles of current page are flushed into the interpolator engine 116 in a spatial order.
Note that the number of primitives for each of the tiles should be a matter of customarily discretion, yet according to the preferred embodiment of the present invention, 16 in a tile is utilized.
Moreover, the tile RAM 1014 has nodes for all tiles on a page, each slot store up to 4 pairs of the coverage masks containing the respective primitive IDs. Tile Sorting 1012 updates the number of the primitives to take into account the incoming data. If the maximum primitive's count of the tile reaches 4, this single tile is flushed in to the interpolator engine 116. And when last tile of the current page is done, the tiles of whole page are sent into the interpolator engine 116 in the spatial order.
From the forgoing descriptions, it can be shown that the present invention also provides a page based 3D graphics rendering system for a displaying screen which is divided into a plurality of tiles, comprising a bank processing device, a page processing device, and a tile processing device.
The bank processing device comprises two banks and their control logics. Referring to
The tile processing device is electrically communicated with the page processing device for rendering the primitives sorted in the page processing device into pixels which are displayed on the display screen in the tiles to form a 3D graphic image.
According to the preferred embodiment, referring to
The tile processing device comprises a tile raster 1010, a tile sorting 1012 and a tile RAM 1014. It adapted to render all primitives of the page nodes. Specifically, when the memory resources of the page RAM 630 less than a predetermined amount, the page nodes, having the corresponding page IDs and the primitives stored under those page IDs, are sent to a tile raster 1010. The tile raster 1010 receives page IDs and the primitive list from the page nodes, and renders all primitives of the page nodes into tiles.
The tile sorting 1012 receives tile information as shown in
As shown in
One skilled in the art will understand that the embodiment of the present invention as shown in the drawings and described above is exemplary only and not intended to be limiting.
It will thus be seen that the objects of the present invention have been fully and effectively accomplished. It embodiments have been shown and described for the purposes of illustrating the functional and structural principles of the present invention and is subject to change without departure from such principles. Therefore, this invention includes all modifications encompassed within the spirit and scope of the following claims.
This is a Continuation-In-part application of a regular application having an application number of Ser. No. 11/299,142 and a filing date of Dec. 8, 2005.
| Number | Date | Country | |
|---|---|---|---|
| Parent | 11299142 | Dec 2005 | US |
| Child | 12218588 | US |