The invention relates generally to rasterizers and, more particularly, to accelerating the conversion of primitives defined by vertexes to equivalent images composed of pixel patterns that can be stored and manipulated as sets of bits.
Raster displays are commonly used in computer graphics systems. These displays store graphics images as a matrix of the smallest picture elements that can be displayed on a screen (“pixels”) with data representing each pixel being stored in a display buffer. This data specifies the display attributes for each pixel on the screen such as the intensity and color of the pixel. An entire image is read from the display buffer and displayed on the screen by sequentially scanning out horizontal rows of pixel data or “scan lines.”
Raster display systems commonly use polygons as basic building blocks or “primitives” for drawing more complex images. Triangles are a common basic primitive for polygon drawing systems, since a triangle is the simplest polygon and more complex polygons can be represented as sets of triangles. The process of drawing triangles and other geometric primitives on the screen is known as “rasterization.”
An important part of rasterization involves determining which pixels fall within a given triangle. Rasterization systems generally step from pixel to pixel in various ways and determine whether or not to “render,” i.e. to draw into a frame buffer or pixel map, each pixel as part of the triangle. This, in turn, determines how to set the data in the display buffer representing each pixel. Various traversal algorithms have been developed for moving from pixel to pixel in a way such that all pixels within the triangle are covered.
Rasterization systems sometimes represent a triangle as a set of three edge-functions. An edge function is a line equation representing a straight line, which serves to subdivide a two-dimensional plane. Edge functions classify each point within the plane as falling into one of three regions: the region “inside” of the triangle, the region “outside” of the triangle or the region representing the line itself. The type of edge function that will be discussed has the property that points “inside” of the triangle have a value greater than zero, points “outside” have a value less than zero, and points exactly on the line have a value of zero. This is shown in
The union of three edges, or more particularly three half-planes, each of which is specified by edge functions, create triangles. It is possible to define more complex polygons by using Boolean combinations of more than three edges. Since the rasterization of triangles involves determining which pixels to render, a tiebreaker rule is generally applied to pixels that lie exactly on any of the edges to determine whether the pixels are to be considered interior or exterior to the triangle.
As shown in
In determining which pixels to render within a triangle, typical rasterization systems compute the values of the edge variables (e0, e1 and e2) for a given set of three edge functions and a given pixel position, and then use a set of increment values (Δeoutside, Δeinside, etc.) to determine the edge variable values for adjacent pixels. The rasterization system traverses the triangle, adding the increment values to the current values as a traversal algorithm steps from pixel to pixel.
With reference again to
f(x,y)>0 if (x,y) is “inside”;
f(x,y)=0 if (x,y) is exactly on the line; and
f(x,y)<0 if (x,y) is “outside”.
Existing rasterization systems commonly use this function, since it can be computed incrementally by simple addition: f(x+1,y)=f(x,y)+dY and f(x,y+1)=f(x,y)−dX.
A variety of different traversal algorithms are presently used by different rasterization systems in the rendering process. Any algorithm guaranteed to cover all of the pixels within the triangle can be used. For example, some solutions involve following the sides of the triangle while identifying a horizontal or vertical span of pixels therein. Following the sides of the triangle is adequate for the triangle edges, but if the triangle is clipped by a near or far plane, these boundaries are not known explicitly and cannot be followed as easily as the triangle edges. Other methods test individual pixels one at a time. In the recent past multiple pixels are tested in parallel to speed up the rasterization process.
Some conventional rasterizers use span-based pixel generation and contain edge and span interpolators based on the well-known Bresenham algorithm. The speed of those rasterizers depends on the interpolation speed. Furthermore, they require a complicated setup process. In most cases such rasterizers interpolate many associated parameters such as color, texture, etc. with appropriate hardware. Increasing the speed of such rasterizers requires a significant increase in the number and complexity of the interpolators, an approach not suitable for commercial products. In the case of clipping support, the structure of such rasterizers is too complex for efficient implementation.
Another approach is to use area rasterizers based on a definition of inner and outer pixels, grouped into blocks, with checking corner pixels' equation values to define inner, border and outer blocks. This approach may accelerate the generation of bit-masks of inner blocks, but the border blocks either need to be processed pixel by pixel or need a significant amount of dedicated hardware for processing those pixels in parallel.
Accordingly, there is a need for a low-cost high-speed rasterizer having a simple and uniform structure and capable of generating multiple spans per clock cycle.
Invention describes a low-cost high-speed programmable rasterizer. The rasterizer accepts as input a set of functionals representing a triangle, clipping planes and a scissoring box, and produces multiple spans per clock cycle as output. A Loader converts the input set, as expressed in one of a number of general forms, to an expression conforming to a special case format as accepted by a set of Edge Generators. The restricted input format accepted by the Edge Generators contributes to their efficient hardware implementation.
a is a diagram illustrating a half-plane, according to an embodiment of the present invention.
b is a diagram illustrating a triangle defined by three half-planes, according to an embodiment of the present invention.
c is a diagram illustrating a polygon defined by a set of half-planes, according to an embodiment of the present invention.
d is a diagram illustrating an opened half-plane and a closed half-plane, according to an embodiment of the present invention.
a is a block diagram illustrating an Edge Generator, according to an embodiment of the present invention.
b is a block diagram illustrating an Edge Generator during the moving-down phase, according to an embodiment of the present invention.
c is a block diagram illustrating an Edge Generator during the Bresenham setup phase, according to an embodiment of the present invention.
a is a block diagram illustrating a Scissoring Box origin, according to an embodiment of the present invention.
b is a block diagram illustrating a Scissoring Box, according to an embodiment of the present invention.
The following servers as a glossary of terms as defined herein:
a·x+b·y+c>0 (1)
a·x+b·y+c>0 (2)
f(x,y)=a·x+b·y+c (3)
f(x,y)=a·x+b·y+c, where a<0 a=0 ̂ b<0 (4)
f(x,y)=a·x+b·y+c, where a<0 a=0 ̂ b<0 (5)
w=x
max
−x
min (6)
W=2ceiling (log
where a>0 and i=0, 1, . . . , ymax−ymin, or
where a=0 and b>0 and i=0, 1, . . . , xmax−xmin
where a<0 and i=0, 1, . . . , ymax−ymin, or
where a=0 and b<0 and i=0, 1, . . . , xmax−xmin
We assume that triangle edge functions are defined as
wherein j=(i+1) mod 3, k=(i+2) mod 3 and [xi,yi], i=0, 1, 2 are triangle vertex coordinates in a standard window coordinate system expressed in the units of the main grid (see above). If the functionals are set up as “implicit” clipping functionals, they should be converted to this format as well.
For a right edge and a given span yi the interpolator should produce xi such that
such an xi point for a≠0 is the last (inclusive) point of the span.
For a left edge and a given span yi the interpolator should produce xi such that
such an xi point for a≠0 is the first (inclusive) point of the span.
If we have a=0 then the edge (left or right) is horizontal, thus the end points of the span for the functional will be x0=0 and x0=W.
In general case we have opened right half-planes and closed left half-planes, classified as follows, also shown in
A Loader 102 transforms a functional given according to a general case into a functional given by the special case, with the special case and the general cases described as follows:
Special Case for the Edge Generator
The Edge Generator 103 (shown in
from which we calculate
The Edge Generator 103 works in a vertical stripe [xmin, xmax] using an x coordinate relative to xmin which satisfies 0≦x≦W, wherein W=2m is the size of the extended bounding box. As described below, the setup division starts as soon as the functional changes sign from negative to positive and f (0, y)>0 hence resulting in x0≧0. Also, Δx>0 according to the above assumption that a<0 and b≧0.
It is possible that the value of the functional f is negative when the Edge Generator 103 starts operating (i.e. when y=0). In this case, the x0 value could be negative and hence does not need to be computed, since we are only interested in the exact x0 values which satisfy 0≦x0≦W.
The completion of the moving-down process is followed by calculating x0=floor (−c/a) and Δx=floor (−b/a) using a division process performed by the divider. Since the divider starts operating when the functional value changes its sign from negative to positive, we can assume that at the start of the division process f (0, y)≧0. To calculate x0 and Δx the divider operates under the assumption that
a<0, b≧0 (17)
and uses a simple adder-based divider. Since a<0, we take
c
i−(−ai)≡ci+ai
b
i−(−ai)≡bi+ai (18)
into consideration start with
c
0
=f(x,y), a0=ã·2m+1, b0={tilde over (b)}, x00=Δx0=0 (19)
and then iterate as follows:
describing the fully functional step-by-step integer divider.
Case 1: Right Open Half-Plane and A<0̂B≧0
The difference between this case and the special case is only that the half-plane is open. Therefore we need to find
Since the coefficients and variables are integer,
and therefore
which reduces this case to the special case. Thus, in this case the Loader 102 (shown in
Case 2: Right Open Half-Plane and A<0̂B<0
Again we need to find
Substituting x=W−{tilde over (x)} we have
and computing maximum in the complimentary semi-plane
and rewriting the constraint and collecting appropriate terms we have
and finally
where
ã=a, {tilde over (b)}=−b, {tilde over (c)}=−c−W·a (29)
which reduces this case to the special case.
Case 3: Right Open Half-Plane and A=0̂B<0
Whereas in the previous case for a<0̂b<0 we had
wherein
ã=a, {tilde over (b)}=−b, {tilde over (c)}=−c−W·a (31)
In this case we have a=0, which means that (30) does not have a maximum. However the division algorithm described above (16) is stable in the case of a zero denominator, producing in this case
x
0=2·W−1x0=W−1−{tilde over (x)}0=−W (32)
after the completion of the division algorithm, indicating that the x value reaches the other edge of the bounding box and that the Edge Generator 103 will draw a horizontal line.
Case 4: Left Closed Half-Plane and A>0̂B≦0
Again we want to find
or equivalently
Substituting a =−ã, b=−{tilde over (b)} and computing the maximum in the complimentary semi-plane, we have
Since the coefficients and variables are integer, we have
and therefore
wherein
ã=−a, {tilde over (b)}=−b, {tilde over (c)}=−c−1 (38)
reducing to the special case.
Case 5: Left Closed Half-Plane and A>0̂B>0
We want to find
Substituting x=W−{tilde over (x)} we have
and therefore
wherein
ã=−a, {tilde over (b)}=b, {tilde over (c)}=c+W·a (42)
reducing to the special case.
Case 6: Left Closed Half-Plane and A=0̂B>0
In the previous case for a>0̂b>0 we had
wherein
ã=−a, {tilde over (b)}=b, ã=c+W·a (44)
In this case we have a=0 resulting in (43) having no maximum. However, the division algorithm described above (16) is again stable in this case of zero denominator, resulting in
{tilde over (x)}
0=2·W−1x0=W−1−{tilde over (x)}0=0 (45)
after the division algorithm completes, indicating that the x value reaches the other edge of the bounding box and that the Edge Generator 103 will draw a horizontal line.
Case 7: The Plane of the Polygon is Parallel to the Clipping Plane and A=0̂B=0
This case indicates that the plane of the polygon is parallel to one of the clipping planes. In this case the sign of c determines whether the plane of the polygon is visible or not. If c<0, then the entire bounding box is invisible. The Edge Generator 103 will function normally, but all spans will be marked as being “outside the bounding box”. Otherwise, all spans will be marked as being “inside the bounding box”.
The next two cases involve wire-frame support.
We restrict the wire-frame mode as not comprising any clipping functionals besides a frustum. This means that a wire-framed triangle comprises (a) three functionals representing the triangle edges and (b) the bounding box.
A wire-framed triangle comprises three parameters for drawing:
Case 8: Right Closed Half-Plane for Wire-Frame and A<0̂B≧0
There is no difference between this case and the special case, so we need to make no corrections for this case
Case 9: Right Closed Half-Plane for Wire-Frame and A≦0̂B<0
Again we need to find
Substituting x=W−{tilde over (x)}
and computing maximum in the complimentary semi-plane
and rewriting the constraint and collecting appropriate terms we results in
and finally
wherein
ã=a, {tilde over (b)}=−b, {tilde over (c)}=−c−W·a−1 (52)
reducing once again to the special case.
The Edge Generator 103 works under the assumption of the special case described above, allowing significant reduction of its hardware and resulting in faster operation. The Loader 102 is the element which transforms a general case to the special case, converting an input functional described by a general case into a form expected by the special case, thereby allowing the Edge Generator 103 to compute edge values correctly and efficiently.
The Loader 102 accepts as inputs a functional and a bounding box offset, and produces a set of coefficients a, b, and c according to the special case for the Edge Generator 103.
We have:
F(x,y)=a·x′+b·y′+c′
Xε[xmin, xmax], [ymin, ymax] (53)
Since the functional coefficients are expressed in the main grid and the x, y coordinates are expressed in the over-sampling grid, we have a grid ratio of s=26+[0, 1, 2] and will convert the c′ value to the over-sampling grid. The particular conversion depends on the type of the half-plane at hand. For a closed half-plane the conversion is as follows:
For an opened half-plane the conversion is as follows:
It is an advantageous aspect of the present invention that two or more Edge Generators 103 may participate in span generation for the same functional. In one embodiment of the present invention, wherein k=1 (respectively 2 or 4) Edge Generators 103 participate in the span generation for the same functional, we want the first span of the 2 (respectively 4 or 8) spans generated per clock cycle to be aligned by y coordinate by 2 (respectively 4 or 8) accordingly. To accomplish this, denote
and substitute {tilde over ({tilde over (x)}=x−xmin, {tilde over ({tilde over (y)}=y−{tilde over (y)}min, {tilde over ({tilde over (c)}=c−a·xmin−b·{tilde over (y)}min to obtain
f({tilde over ({tilde over (x)}, {tilde over ({tilde over (y)})=a·{tilde over ({tilde over (x)}+b·{tilde over ({tilde over (y)}+{tilde over ({tilde over (c)} (56)
The size of the bounding box is (xmax−xmin)·(ymax−ymin). Here we take
m=ceiling (log 2(xmax−xmin)) (57)
W=2m (58)
Observing the above cases, taking (23), (52), (38) and (42) in consideration and uniting common expressions results in
The number of c values generated according to the foregoing description corresponds to the number of spans that are to be generated per clock cycle, wherein an Edge Generator 103 generates two spans per clock cycle. Each Edge Generator's 103 spans are to be aligned by y such that the first span is even (i.e. ymin mod 2=0) and the second is odd (i.e. ymin mod 2=1). If the ymin of the bounding box is odd, span generation starts from ymin−1. To accomplish that, denote
c
0
0
={tilde over (c)}−{tilde over ({tilde over (b)}·(ymin mod 2)
c
1
0
=c
0
0
+{tilde over ({tilde over (b)}
{tilde over (b)}=2·{tilde over ({tilde over (b)} (62)
In the case of more than one Edge Generator 103 participating in span generation for the functional, we need to have more than one set of initial values for the spans. Assuming the number of Edge Generators 103 is k (wherein k=1, 2 or 4), the set of initial values is given by
c
j
i
=c
j
0+2·{tilde over ({tilde over (b)}·i, i=1, . . . , k, j=0, 1
{tilde over (b)}=k·{tilde over ({tilde over (b)} (63)
and the Edge Generators 103 participating in the span generation for the given functional are loaded with the initial values of cji, {tilde over (b)} and ã.
Before the Bresenham traversal, an Edge Generator 103 performs two operations: moving-down and Bresenham setup. The initial values are
f({tilde over (x)},{tilde over (y)})=ã·{tilde over (x)}+{tilde over (b)}·{tilde over (y)}+{tilde over (c)}, x=0, y=0 (64)
with the goal of computing for each given {tilde over (y)}
Additionally, an Edge Generator 103 generates an {tilde over (x)} inside the bounding box. Therefore, if x0 is outside the bounding box, x0 is substituted by 0 or W such that
After converting to a special case within the bounding box, we have f({tilde over (x)},{tilde over (y)})<0 for the points above the edge (represented by the functional) and f({tilde over (x)},{tilde over (y)})≧0 on or below the edge, wherein “above” refers to smaller y coordinates and “below” refers to greater y coordinates. We also have b≧0 and a<0 as given by the special case conditions.
{tilde over (y)}0=0
f
0
=f(0,0)=ã·0+{tilde over (b)}·0+{tilde over (c)}={tilde over (c)}
f
i
=f(0,i)={tilde over (b)}·i+f0={tilde over (b)}·(i−1)+{tilde over (b)}f0=fi−1+{tilde over (b)} (67)
The moving-down process is followed by the Bresenham setup process. The purpose of the Bresenham setup is to find the two values
and
Furthermore, since
{tilde over (b)}·{tilde over (y)}
k
+{tilde over (c)}=f(0,{tilde over (y)}k) (70)
we obtain
The division algorithm described above (see Special Case) is modified as follows for more efficient hardware implementation:
c
0
=f(0,{tilde over (y)}k), a0=ã·2m+1, b0={tilde over (b)}, x00=Δx0=0 (72)
with the following steps describing the iterations:
The values e0=cm+1=f(0, {tilde over (y)}k)mod|a| and r0=bm+1=|b|mod|a| are used in the Bresenham walk (described below) for calculating the Bresenham error. The value
is the x value for the first span after the moving-down process. The value
is the span-to-span x-increment value.
The Bresenham walk is the process following the moving-down and Bresenham setup processes. After the Bresenham setup we have
ã·{tilde over (x)}+{tilde over (b)}·{tilde over (y)}+{tilde over (c)}=0 (74)
wherein
and
ã·{tilde over (x)}
n
+{tilde over (b)}·{tilde over (y)}
n+k
+{tilde over (c)}=ã·{tilde over (x)}
n
+{tilde over (b)}·{tilde over (y)}
n+k
+f(0,{tilde over (y)}k)−{tilde over (b)}·{tilde over (y)}k=0 (76)
ã·{tilde over (x)}
n
+{tilde over (b)}·{tilde over (y)}
n
+f(0,{tilde over (y)}k)=0 (77)
we want to find
wherein h represents a height of the bounding box and yk represents the value of the y coordinate at the Bresenham setup point. To simplify the hardware, the error value is decremented by |a| at the beginning of the Bresenham walk, after which en can be compared to 0, with the comparison being simpler to implement in hardware. We also calculate
r
1
=r
0
−|a|
{tilde over (e)}
0
=e
0
+r
0
−|a| (79)
after which the Bresenham walk is more simply described as follows:
Input Interface 105 packs input functionals for passing to the three Loaders 102. Loaders 102 perform Edge Generator 103 initialization. Edge Generators 103 generate “left” and “right” edges, which are then sorted in tournament Sorters 104. The Sorters' 104 output is directed via Output Interface 106 to a Tile Generator (TG), the TG for converting a set of spans into a sequence of tiles, wherein a tile refers to a rectangle set of pixels to be rendered.
Advantageously, the Span Generator 101 solves the following issues:
The Span Generator 101 has the following input interface:
We assume the wire-frame will be done as three functionals for edges inside the tight bounding and scissoring boxes. That means we do not support clipping planes for wire-frame. The span generation for the wire-frame mode does not take anything special besides the Loader 102 should supply corrected functional values for two nested triangles. The inner triangle is a set of points on the current grid, which should be excluded from the outer triangle. For an edge f(x, y)=a·x+b·y+c, the functional values for that two triangles will be
f
1(x,y)=a·x+b·y+c+w/2—outer edge
f
2(x,y)=a·x+b·y+c−w/2—inner edge
where w is a width of the wireframe edges.
SHORT xMin, yMin, xMax, yMax, a, b;
SHORT nF; // the number of the functionals
and outputs
SHORT c01, c0h, c1l, c1h, bl, bh, al, ah, m;
BOOL dir, cor
Initially, a Loader 102 determines the global values, which are the same for all of the functionals in the polygon. To accomplish this, the Loader 102 computes the parameters of the bounding box:
SHORT w=xMax−xMin;
m=ceiling (log 2 (w));
SHORT h=yMax−yMin;
SHORT k=(nF>6)? 1 : (nF>3);
SHORT aT, bT; // ã and {tilde over (b)}
Then for each functional the Loader 102 computes
The Loader 102 then computes two separate functional values for two sequential spans, and in the case of having k=1, 2, 4 Edge Generators 103 per functional, the Loader 102 also computes values for all other two or six sequential spans:
value is also needed, the {tilde over (b)} value is also pre-scaled. The scaled f(0, {tilde over (y)}k) value is longer than the non-scaled value. However, this does not necessitate a longer adder for performing the moving-down process: The least significant bits of the scaled f(0, {tilde over (y)}k) value are wrapped to the most significant bits (i.e. a cyclic rotation instead of an arithmetical shift), resulting in the scaled f(0, {tilde over (y)}k) value being expressed within the same bit-length as the non-scaled value. To avoid carry propagation from MSB to LSB, invert the sign bit before loading data into an Edge Generator 103. In the case of f(0, {tilde over (y)}k)<0 this bit would be 0 and would not propagate a carry. To detect if f(0, {tilde over (y)}k)≧0, compare this bit to 1. The {tilde over (b)} value is scaled in a similar way, with the difference that it is not wrapped.
At the first clock cycle of the division process, Edge Generator 103 determines whether one of the f(0, {tilde over (y)}k) or {tilde over (b)} values exceed the boundaries, i.e. it determines whether the division result would be greater than or equal to W. For that purpose, the real scale factor is not m, but m+1. The division works in the above-described way, but if the result is not below W, either x0 will be beyond the bounding box limit or the result after the first Bresenham step would be beyond the bounding box limit.
The Loader 102 loads the Edge Generators 103 sequentially, starting from the first three functionals of each triangle, with the first functional loaded into the first Edge Generator 103, and so on. If there are only three functionals, the Loader 102 loads other Edge Generators 103 with the functional values for other three groups of spans on the next sequential clock cycles.
Considering the input interface and the approach of loading several Edge Generators 103 at subsequent clock cycles, the pseudo-code for the Loader 102 is as follows:
a is a block diagram illustrating an Edge Generator, according to an embodiment of the present invention. The Edge Generator 103 comprises four 24-bit adders and eight 24-bit registers. An adder has the outputs of two registers as inputs, wherein the inputs of the registers are multiplexed:
bool carry [4];
add [0]=reg [0]+reg [4]+carry [0];
add [1]=reg [1]+reg [5]+carry [1];
add [2]=reg [2]+reg [4]+carry [2];
add [3]=reg [3]+reg [7]+carry [3];
for (i=0; i<8; i ++)
reg [i]=some_function (add [k], reg [k], . . . );
The registers' outputs are supplied directly to inputs of adders to minimize a delay at the adders. The structure of multiplexers allows us to minimize a delay at them also, the maximal post-adder delay supposed to be not more than 3×1 multiplexer.
Besides the implementation of the general functionality, the multiplexers are also performing loading and stalling operations by writing a new set of data or a previous state of an Edge Generator 103 back to registers.
The basic functionality of an Edge Generator 103 comprises three main phases: moving-down, Bresenham setup and Bresenham walk. There are also seven interim states, which are: load, stall, first clock of moving down, transfer from moving down to Bresenham setup, two different clocks of transfer from Bresenham setup to Bresenham walk and finally first clock of the Bresenham.
An Edge Generator 103 has the following inputs:
SHORT c0l, c0h, c1l, c1h, bl, bh, al, ah, m;
BOOL dir, cor, load, stall;
When the load signal is set, the Edge Generator 103 stores the input values in internal registers and resets its state. When the stall signal is set, the Edge Generator 103 registers retain their content for the current clock cycle.
b is a block diagram illustrating an Edge Generator 103 during the moving-down phase, according to an embodiment of the present invention. The functional value is accumulated in the register, which was loaded with the value of {tilde over (c)} at the start. At this phase each Edge Generator 103 performs the following:
Applying this to the hardware, we obtain:
The masks are for preliminary zero crossing detection, and their use allows avoiding “backing-down” the functional value, since the data is not written back to ch and the LSBs of ch remain intact. The masks also allow detection of a zero crossing one clock cycle earlier.
c is a block diagram illustrating an Edge Generator during the Bresenham setup phase, according to an embodiment of the present invention. The division algorithm was described above under “Special Case”, and is implemented as follows:
After the Bresenham setup process completes, the four values ch, cl, bh and bl are produced, indicating the Bresenham error, x0, positive correction value and Δx, respectively. To perform edge generation we also need a negative correction value r1. The Loader 102 sets the Boolean variables dir and cor. Setting the variable dir to 1 indicates that the Edge Generator 103 subtracts the x value from W. Setting the cor variable to 1 indicates that the Edge Generator 103 adds 1 to the x value. If the x value overflows, an appropriate flag is set depending on the value of the dir variable.
For the Scissoring Box, a divider-by-3 is used to multiply the y offset by ⅓. A pseudo-code for a 15-bit divider-by-3 is as follows:
a is a block diagram illustrating a Scissoring Box origin, according to an embodiment of the present invention. The Span Generator 101 comprises a Scissoring Box module 107 for providing scissoring by a view-port, rotated relative to the x and y axes by an angle with tangent 0, 1, ½ and ⅓ (hereinafter also referred to as tangent 0, 1, 2, 3, respectively). The vertical coordinate y0 of the upper-left corner of the rotated Scissoring Box is 0, and the horizontal coordinate x1 of the lower-left corner is also 0. Optionally, the Scissoring Box can be used in an optional embodiment of the present invention having an over-sampling scheme.
The Scissoring Box has its origin specified by four points. The coordinates of the points are calculated by the driver (i.e. the software controlling the graphics chip) and stored in registers. The y coordinate of the upper corner is y0=0. The Scissoring Box device performs calculation of the initial Scissoring Box coordinates for the first span. After that, the Scissoring Box device calculates up to eight Scissoring Box coordinates per clock cycle for current spans.
b is a block diagram illustrating a Scissoring Box, according to an embodiment of the present invention. The device to draw the Scissoring Box generates spans between two edges of the Scissoring Box. Two parts of the Scissoring Box generate both edges using the information about starting values of x and y coordinates, y coordinates of corners and rotation angle tangent:
The pair of the coordinates x0, x1 is then sorted among the edge coordinates by Edge Generator 103.
As illustrated in
The Span Buffer interface (also known as the Output Interface 106 shown in
At this point of the span generation process, the computed values comprise the output of the last Sorter s3 and the bypassed outputs of the three other Sorters s0, s1 and s2. Also available are the current y coordinate, the xmin and xmax parameters of the bounding box, and k=1, 2, 4 representing the number of Edge Generators 103 computing spans for the same functional. Also note that the Sorters 104 are doubled, since at the lowest rate there are two spans generated per clock cycle, and therefore two spans are processed per clock cycle in parallel.
Foregoing described embodiments of the invention are provided as illustrations and descriptions. They are not intended to limit the invention to precise form described. In particular, it is contemplated that functional implementation of invention described herein may be implemented equivalently in hardware, software, firmware, and/or other available functional components or building blocks, and that networks may be wired, wireless, or a combination of wired and wireless. The pseudo-code fragments represent high-level implementation examples and are intended to illustrate one way of implementing functionalities described herein. Other variations and embodiments are possible in light of above teachings, and it is thus intended that the scope of invention not be limited by this Detailed Description, but rather by Claims following.
This application is a continuation of U.S. Ser. No. 10/746,055, filed Dec. 23, 2003, which is incorporated herein by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
Parent | 10746055 | Dec 2003 | US |
Child | 12045776 | US |