The patent or application file contains at least one drawing executed in color. Copies of this patent or patent application publication with color drawings will be provided by the Office upon request and payment of the necessary fee. These and/or other aspects and advantages of the invention will become apparent and more readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
Reference will now be made in detail to the embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the like elements throughout. The embodiments are described below to explain the present invention by referring to the figures.
Referring to
Before processing of the rasterizer 2, geometry processing typically should be performed. In geometry processing, the object may be divided into a number of polygons, and parameter values of fragments constructing each polygon may be respectively determined. The parameter values of the fragments may form fragment unit information for rendering the object divided into polygons into a 3-dimensional graphic image. Each parameter value may include, for example, a depth value (z) and a color value (r, g, b, a) of the corresponding fragment, a coordinate value (s, t) of a texture that is to be mapped to the corresponding fragment, etc. Here, “r” may represent red, “g” may represent green, “b” may represent blue, and “a” may represent information indicating whether the corresponding fragment is transparent. Also, “s” and “t” may represent normalized coordinate values (e.g., from 0 to 1) of the texture.
Generally, in order to reduce the number of rendering calculations, a triangle, which is the simplest form among various forms of polygons, may be used. Hereinafter, an embodiment will be described based on the assumption that the polygon is a triangle. However, it will be understood by one of ordinary skill in the art that other forms of polygons apart from a triangle may equally be applied to embodiments of the present invention.
The span conversion unit 21 may decide the parameter values of the fragments constructing the triangle. In more detail, the span conversion unit 21 may receive coordinate values of three vertices of the triangle, from among the fragments constructing the triangle, from a vertex buffer 1, and may calculate parameter values of fragments corresponding to the three vertices of the triangle, using Equation 1. Also, the span conversion unit 21 may interpolate parameter values of the remaining fragments apart from the fragments corresponding to the vertices of the triangle, from the parameter values of the fragments corresponding to the vertices.
In particular, according to an embodiment, the span conversion unit 21 may calculate Level Of Detail (LOD) values of the fragments corresponding to the three vertices of the triangle, from among the fragments constructing the triangle, and interpolate LOD values of the remaining fragments apart from the fragments corresponding to the vertices of the triangle, from the LOD values of the fragments corresponding to the vertices, using a scheme similar to a conventional parameter value interpolation scheme. That is, the span conversion unit 21 may calculate LOD value gradients of the fragments corresponding to the three vertices of the triangle, according to the conventional parameter value interpolation scheme, and interpolate LOD values of the remaining fragments, using the LOD value gradients. As such, the span conversion unit 21 may calculate LOD values as well as parameter values, in contrast with conventional span conversion methods. Conventionally, LOD values have been calculated in a texture mapping process.
Referring to
The polygon processor 31 may calculate parameter value gradients on an x-axis of the triangle and parameter value gradients on a y-axis of the triangle, from the parameter values of the fragments corresponding to the three vertices of the triangle, with respect to two edges starting from a vertex whose y coordinate value is the minimum, from among three edges of the triangle. Particularly, according to the current embodiment, the polygon processor 31 may calculate LOD values of the fragments, using a scheme similar to a conventional parameter polygon processing scheme. That is, the polygon processor 31 may calculate LOD values of the fragments corresponding to the three vertices of the triangle, among the fragments constructing the triangle, and calculate LOD value gradients on the x-axis of the triangle and LOD value gradients on the y-axis of the triangle, from the LOD values of the fragments corresponding to the three vertices of the triangle, with respect to two edges starting from a vertex whose y coordinate value is the minimum, from among three edges of the triangle.
For example, the polygon processor 31 may calculate the LOD value gradients on the x-axis of the triangle, and the LOD value gradients on the y-axis of the triangle, using the following Equations 2.
Emaj—dλ=Vmax−Vmin;
Ebot—dλ=Vmid−Vmin;
dλ/dx=(Emaj—dλ*Ebot—dy−Emaj—dy*Ebot—dλ)/(Emaj—dx*Ebot—dy−Emaj—dy*Ebot—dx);
dλ/dy=(Emaj—dx*Ebot—dλ−Emaj—dλ*Ebot—dx)/(Emaj—dx*Ebot—dy−Emaj—dy*Ebot—dx); Equation 2:
In this example, the number of addition, subtraction, multiplication and division (+, −, *, /) calculations performed may be (0, 4, 4, 0), respectively. In the equations 2, “Vmax” represents an LOD value of a vertex whose y coordinate value may be the maximum, “Vmid” represents an LOD value of a vertex whose y coordinate value may be in the middle, and “Vmin” represents an LOD value of a vertex whose y coordinate value may be the minimum. Also, “dλ/dx” represents the LOD value gradients on the x-axis of the triangle, and “dλ/dy” represents the LOD value gradients on the y-axis of the triangle.
The edge processor 32 may calculate parameter values of fragments corresponding to the two edges of the triangle, using the parameter value gradients on the x-axis and the parameter value gradients on the y-axis calculated by the polygon processor 31, with respect to each span constructing the triangle, and may calculate parameter value differences between fragments constructing the span. Here, the span may refer to a horizontal group of fragments whose ends correspond to two edges of the triangle.
Particularly, according to an embodiment, the edge processor 32 may calculate LOD values of the fragments corresponding to the two edges of the triangle, using a scheme similar to a conventional parameter edge processing scheme, and may calculate LOD value differences between fragments constructing each span. That is, the edge processor 32 may calculate LOD values of fragments corresponding to the two edges of the polygon, for example, using the LOD value gradients on the x-axis and the LOD value gradients on the y-axis calculated by the polygon processor 31, with respect to each span constructing the triangle, and may calculate LOD value differences between the fragments constructing each span.
For example, in an embodiment, the edge processor 32 may calculate the LOD values of the fragments corresponding to the two edges of the triangle, and may calculate the LOD value differences between the fragments constructing each span, using the following Equations 3.
{Compare;
fλ=λ0+adjx*dλ/dx+adjy*dλ/dy;
fdλOuter=dλ/dy+fdxOuter*dλ/dx;}
fdλInner=fdλOuter+dλ/dx; Equations 3:
In the example, when edges are processed, the number of (+, −, *, /) calculations performed may equal “the number of spans*{(3, 0, 3, 0)+compare}+(1, 0, 0, 0)”, respectively. Here, “compare” may be a comparison operation for selecting one from among the three edges of the triangle. By using the comparison operation, one of Vmin, Vmid, and Vmax may be selected as a start vertex for interpolating the LOD values of the fragments. “λ0” represents an LOD value of the start vertex selected by the “compare” operation. Also, “adjx” represents a difference between a center coordinate value of the fragment corresponding to the start vertex with respect to the x-axis, and an actual coordinate value of the start vertex. Also, “adjy” represents a difference between a center coordinate value of the fragment corresponding to the start vertex with respect to the y-axis, and an actual coordinate value of the start vertex. Accordingly, “fλ” may become an LOD value of the center of the fragment corresponding to the start vertex. This process may be performed so as to separately calculate an LOD value of the center of the fragment corresponding to the start vertex, considering the fact that the actual coordinates of the start vertex may not be located on the exact center of the corresponding fragment. Also, “fdxOuter” represents a gradient dx/dy of an edge which is currently being calculated. Accordingly, “fdλOuter” may become 2*dλ/dy and “fdλInner” may become 2*dλ/dy+dλ/dx. These two values may be used for the following span processing, when an LOD value calculation for a span which is currently being calculated is terminated and an LOD value calculation for a different span is started.
The span processor 33 may calculate parameter values of fragments constructing each span, using, for example, differences between the parameter values of the fragments corresponding to the edges calculated by the edge processor 32 and the parameter values of the fragments constructing each span, with respect to each span constructing the triangle.
In particular, according to an embodiment, the span processor 33 may calculate LOD values of fragments constructing each span, using a scheme similar to a conventional parameter span processing scheme. That is, the span processor 33 may calculate LOD values of the fragments constructing each span, using LOD values of fragments corresponding to edges calculated by the edge processor 32, and LOD value differences between the fragments constructing each span, with respect to each span constructing the triangle.
For example, the span processor 33 may calculate LOD values of fragments constructing each span, by performing two processes, e.g., a first process and a second process. The first process may be performed when an LOD value calculation proceeds from a current span to a following span, and the second process may be performed on each span constructing a triangle.
When the LOD value calculation proceeds from the current span to the following span, Equations 4 may be used.
{ffλend=fdλ+(Right−Left−1)*dλ/dx;
fλ=fλ+fdλOuter or fλ=fλ+fdλInner;
fλ=fλ−ffλend;}
{fλ=fλ+dλ/dx} Equations 4:
In the above example, the number of (+, −, *, /) calculations performed for span processing may equal {the number of spans*(3, 0, 1, 0)+the number of fragments*(1, 0, 0, 0)”}, respectively. In Equations 4, “Right-Left” represents the total number of fragments constructing the current span. Accordingly, “ffλend” becomes an LOD value of a final fragment among the fragments constructing the current span. Determination as to which one of “fdλOuter” and “fdλInner” to “fλ” should be added depends on which one of “fdλOuter” and “fdλInner” is greater than the remaining one. That is, whichever of an LOD value gradient on the x-axis and an LOD value gradient on the y-axis is greater than the remaining one may be determined by comparing the two values “fdλOuter” and “fdλInner” with each other. If the LOD value gradient on the x-axis is greater than the LOD value gradient on the y-axis, “fdλOuter” may be added to “fλ”. If the LOD value gradient on the y-axis is greater than the LOD value gradient on the x-axis, “fdλInner” may be added to “fλ”. By this selective adding process, an LOD value “fλ” of a fragment corresponding to an edge of the following span may be calculated. The operation of “fλ=fλ−ffλend” may be performed when the value “fλ” overflows, that is, when the value “fλ” exceeds predetermined bits assigned to the LOD value.
The second process may be performed in order to calculate LOD values of fragments constructing a span by adding “dλ/dx” corresponding to a unit gradient to “fλ” while increasing a y value by one. The second process may be easily implemented by one of ordinary skill in the art.
The texture mapping unit 22 may map one of a number of textures with various resolutions to the corresponding fragment, on the basis of the LOD values of the fragments calculated or interpolated by the span conversion unit 21, according to a Mipmap method, for example. In more detail, if an LOD value of a fragment is increasing, the texture mapping unit 22 may map a texture with a higher resolution from among the textures with various resolutions to the corresponding fragment. If an LOD value of a fragment is decreasing, the texture mapping unit 22 maps a texture with a lower resolution from among the textures with various resolutions to the corresponding fragment. By performing this texture mapping process, an image corresponding to the texture may be applied to an object.
The alpha test unit 23 may compare an alpha value a from among the parameter values of the fragments calculated or interpolated by the span conversion unit 21, with a predetermined reference value, and determine whether the respective fragments are transparent, according to the comparison result.
If a depth value z from among the parameter values of the fragments calculated or interpolated by the span conversion unit 21 is smaller than a depth value stored in a depth buffer (not shown), the depth test unit 24 may update the depth value stored in the depth buffer to the depth value z.
The color blending unit 25 may blend the parameter values of the fragments calculated or interpolated by the span conversion unit 21, with color values stored in a pixel buffer (not shown), thereby outputting final values of pixels on a screen corresponding to the fragments. In particular, the color blending unit 25 may output the texture mapped by the texture mapping unit 22, the transparency determination results determined by the alpha test unit 23, and final values of pixels in which depth values updated by the depth test unit 24 are reflected, to a frame buffer 3.
In operation 41, coordinate values of three vertices of a triangle may be received, e.g., by the rasterizer 2, among fragments constructing the triangle, from a vertex buffer 1, and parameter values and LOD values of fragments corresponding to the three vertices of the triangle, may be calculated using, for example, Equation 1. Also, in operation 41, parameter values and LOD values of the remaining fragments apart from the fragments corresponding to the three vertices of the triangle may be interpolated, from among the parameter values and LOD values of the three vertices.
In operation 42, one of a number of textures with various resolutions may be mapped to the corresponding fragment, on the basis of the respective LOD values of the fragments calculated or interpolated in operation 41, according to, for example, the Mipmap method.
In operation 43, an alpha value a of the parameter values of the fragments calculated or interpolated in operation 41, may be compared with a predetermined value, and the comparison result may be used to determine whether the respective fragments are transparent.
In operation 44, if a depth value z from among the parameter values of the fragments calculated or interpolated in operation 41 is smaller than a depth value stored in the depth buffer, the depth value of the depth buffer may be updated to the depth value z.
In operation 45, the respective parameter values of the fragments calculated or interpolated in operation 41 may be blended with color values stored in the pixel buffer, thereby outputting the texture mapped in operation 42, the transparency determination result determined in operation 43, and final values of pixels in which depth values updated in operation 44 are reflected, to the frame buffer 3.
In operation 51, LOD values of fragments corresponding to three vertices of a triangle, may be calculated, e.g., by the span conversion unit 21, from among fragments constructing the triangle.
In operation 52, parameter value gradients and LOD value gradients on an x-axis of the triangle and parameter value gradients and LOD value gradients on a y-axis of the triangle may be calculated, from parameter values and LOD values of the fragments corresponding to three vertices of the triangle, with respect to two edges starting from a vertex whose y coordinate value is the minimum, from among three edges of the triangle.
In operation 53, parameter values and LOD values of fragments corresponding to the two edges of the triangle, may be calculated using the parameter value gradients and LOD value gradients on the x-axis and the parameter value gradients and LOD value gradients on the y-axis calculated in operation 52, with respect to each span constructing the triangle, and then parameter value differences and LOD value differences between fragments constructing each span may be calculated.
In operation 54, parameter values and LOD values of fragments constructing each span may be calculated, using the parameter values and LOD values of the fragments corresponding to the edges calculated in operation 53, and the parameter value differences and LOD value differences between the fragments constructing each span may be calculated, with respect to each span constructing the triangle.
In
Referring to
Referring to
Comparing the conventional LOD value calculation scheme illustrated in
Referring to
In
In an embodiment, if it is assumed that the number “F” of fragments is 25 in the comparison table illustrated in
In addition to the above described embodiments, embodiments of the present invention may also be implemented through computer readable code/instructions in/on a medium, e.g., a computer readable medium, to control at least one processing element to implement any above described embodiment. The medium can correspond to any medium/media permitting the storing and/or transmission of the computer readable code.
The computer readable code may be recorded/transferred on a medium in a variety of ways, with examples of the medium including recording media, such as magnetic storage media (e.g., ROM, floppy disks, hard disks, etc.) and optical recording media (e.g., CD-ROMs, or DVDs), and transmission media such as carrier waves, as well as through the Internet, for example. Thus, the medium may further be a signal, such as a resultant signal or bitstream, according to embodiments of the present invention. The media may also be a distributed network, so that the computer readable code is stored/transferred and executed in a distributed fashion. Still further, as only an example, the processing element could include a processor or a computer processor, and processing elements may be distributed and/or included in a single device.
As described above, according to one or more embodiments of the present invention, by calculating LOD values of fragments corresponding to vertices of a polygon and interpolating LOD values of the remaining fragments from the LOD values of the fragments corresponding to the vertices of the polygon, it may be possible to significantly reduce the number of calculations required for obtaining LOD values, and accordingly reduce power consumption in a 3D rendering system. In particular, according to one or more embodiments of the present invention, by interpolating LOD values using a scheme similar to the conventional parameter value interpolation scheme, it may be possible to minimize the number of circuit devices required for calculating LOD values.
Although a few embodiments of the present invention have been shown and described, it would be appreciated by those skilled in the art that changes may be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the claims and their equivalents.
| Number | Date | Country | Kind |
|---|---|---|---|
| 10-2006-0082498 | Aug 2006 | KR | national |