Efficient rasterization of specular lighting in a computer graphics system
First Claim
1. A scan converter for scanning edge and span portions of a graphics primitive to convert the primitive to fragments in a rasterized form of the primitive, the scan converter comprising:
- at least one interpolator each of which is configured to calculate diffuse and specular lighting component values at each fragment of an edge or span portion of the primitive, wherein for each edge or span portion of the primitive that has a non-negligible specular lighting component, each interpolator which is to interpolate fragments of that edge or span portion separately calculates the diffuse and specular lighting component values at each such fragment of that edge or span portion of the primitive.
2 Assignments
0 Petitions
Accused Products
Abstract
A rasterizer implementing a single edge stepping interpolator to interpolate both diffuse and specular lighting components across an edge of the primitive, and/or a single span stepping interpolator to interpolate both diffuse and specular lighting components across the spans of the primitive. When the edge or span being interpolated includes a non-negligible specular lighting component, the diffuse and specular lighting components are separately and successively rasterized. Otherwise, only the diffuse lighting component is interpolated over the edge or span.
-
Citations
20 Claims
-
1. A scan converter for scanning edge and span portions of a graphics primitive to convert the primitive to fragments in a rasterized form of the primitive, the scan converter comprising:
-
at least one interpolator each of which is configured to calculate diffuse and specular lighting component values at each fragment of an edge or span portion of the primitive, wherein for each edge or span portion of the primitive that has a non-negligible specular lighting component, each interpolator which is to interpolate fragments of that edge or span portion separately calculates the diffuse and specular lighting component values at each such fragment of that edge or span portion of the primitive. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
at least one first interpolator each constructed and arranged to calculate diffuse and specular lighting component values of each edge portion of the primitive; and
at least one second interpolator each constructed and arranged to calculate diffuse and specular lighting component values of each span portion of the primitive.
-
-
3. The scan converter of claim 1, wherein the scan converter is an element of a rasterizer that further comprises:
a separate specular accelerator that determines the specular lighting component value at each edge and span portion of the primitive, and that commands each at least one interpolator which is to interpolate an edge or span portion of the primitive having a non-negligible specular lighting component, to separately calculate in successive processing states the diffuse and specular lighting component values for of each fragment of that portion of the primitive.
-
4. The scan converter of claim 3, wherein the rasterizer is an element of a graphics system further comprising:
-
a frame buffer; and
a fragment processor constructed and arranged to generate pixel data to be written into the frame buffer for subsequent rendering on a display device, wherein the fragment processor is responsive to commands generated by the rasterizer, each command indicating whether a corresponding fragment data word includes a non-negligible specular lighting component value.
-
-
5. The scan converter of claim 4, wherein the pixel data generated by the fragment processor includes a color value for each fragment,
wherein the color value is set equal to the product of the diffuse lighting component value and a texture component value of the fragment when the fragment includes a negligible specular lighting component value, and wherein the color value is set equal to the sum of the specular lighting component and the product of the diffuse lighting component value and the texture component value of the fragment when the fragment includes a non-negligible specular lighting component value. -
6. The scan converter of claim 1, wherein when an edge or span portion of the primitive includes a negligible specular lighting component, the at least one interpolator calculates only the diffuse lighting component for each fragment of that edge or span portion of the primitive.
-
7. The scan converter of claim 1, wherein at least one fragment is represented by a plurality of fragment data words each comprising data defining a corresponding pixel of the rasterized form of the primitive.
-
8. The scan converter of claim 7, wherein the plurality of fragment data words comprises:
-
a first data word comprising the diffuse lighting component value of the represented fragment; and
a second data word comprising the specular lighting component value of the represented fragment.
-
-
9. The scan converter of claim 1, wherein each at least one interpolator is a circuit comprising:
-
delta specular and delta diffuse registers adapted to store an incremental value for the respective specular and diffuse lighting component at each fragment of an edge or span portion of the primitive;
current specular and current diffuse registers adapted to store a current value of the respective specular and diffuse lighting component for each fragment of an edge or span portion of the primitive;
an adder circuit having a first input connected to the delta specular and delta diffuse registers through a first multiplexer, and a second input connected to the current specular and current diffuse registers through a second multiplexer, wherein the adder adds the incremental value and the current value for the specular or diffuse lighting component to generate a new current specular or diffuse lighting component; and
a third multiplexer having a first input connected to an output of the adder and a second input at which initial values of the specular and diffuse lighting components are received, and an output connected to an input of the current specular and diffuse registers, the multiplexer forwarding either the initial or new current diffuse and specular lighting component values for storage in the respective current diffuse and specular registers.
-
-
10. The scan converter of claim 1, wherein the specular lighting component comprises red, green and blue specular lighting components and the diffuse lighting component comprises red, green and blue diffuse lighting components, and wherein the at least one interpolator comprises:
-
three interpolators each configured to calculate, for each fragment of each edge portion of the primitive, one of red specular and diffuse lighting component values, green specular and diffuse lighting component values, and blue specular and diffuse lighting component values; and
three interpolators each configured to calculate, for each fragment of each span portion of the primitive, one of red specular and diffuse lighting component values, green specular and blue diffuse lighting component values, and blue specular and diffuse lighting component values.
-
-
11. The scan converter of claim 1, wherein a negligible specular lighting component value is a value of zero.
-
12. A rasterizer to rasterize graphics primitives to their component pixels, the rasterizer comprising:
-
a scan converter for scanning edge and span portions of a primitive to convert the primitive to fragments in a rasterized form of the primitive, the scan converter comprising at least one interpolator each of which is configured to calculate diffuse and specular lighting components at each fragment of the edge or span portion of the primitive, wherein for each edge or span portion of the primitive having a non-negligible specular lighting component, the at least one interpolator scan converts each fragment of that edge or span portion in two processing states comprising a first processing state in which a diffuse lighting component value for the fragment is determined, and a second processing state in which a specular lighting component value of that same fragment is determined. - View Dependent Claims (13, 14, 15, 16, 17)
at least one first interpolator each constructed and arranged to calculate diffuse and specular lighting component values of each edge portion of the primitive; and
at least one second interpolator each constructed and arranged to calculate diffuse and specular lighting component values of each span portion of the primitive.
-
-
14. The rasterizer of claim 12, wherein when an edge or span portion of the primitive includes a negligible specular lighting component, the at least one interpolator calculates only the diffuse lighting component for each fragment of that edge or span portion of the primitive.
-
15. The scan converter of claim 12, wherein one or more of the fragments is represented by a plurality of fragment data words each comprising data defining a corresponding pixel of the rasterized form of the primitive.
-
16. The rasterizer of claim 12, wherein each of the at least one interpolator is a circuit comprising:
-
delta specular and delta diffuse registers configured to store an incremental value for the respective specular and diffuse lighting component at each fragment of an edge or span portion of the primitive;
current specular and current diffuse registers configured to store a current value of the respective specular and diffuse lighting component for each fragment of an edge or span portion of the primitive;
an adder circuit having a first input connected to the delta specular and delta diffuse registers through a first multiplexer, and a second input connected to the current specular and current diffuse registers through a second multiplexer, wherein the adder adds the incremental value and the current value for the specular or diffuse lighting component to generate a new current specular or diffuse lighting component; and
a third multiplexer having a first input connected to an output of the adder and a second input at which initial values of the specular and diffuse lighting components are received, and an output connected to an input of the current specular and diffuse registers, the multiplexer forwarding either the initial or new current diffuse and specular lighting component values for storage in the respective current diffuse and specular registers.
-
-
17. The rasterizer of claim 12, wherein the specular lighting component comprises red, green and blue specular lighting components and the diffuse lighting component comprises red, green and blue diffuse lighting components, and wherein the at least one interpolator comprises:
-
three interpolators each configured to calculate, for each fragment of each edge portion of the primitive, one of red specular and diffuse lighting component values, green specular and diffuse lighting component values, and blue specular and diffuse lighting component values; and
three interpolators each configured to calculate, for each fragment of each span portion of the primitive, one of red specular and diffuse lighting component values, green specular and blue diffuse lighting component values, and blue specular and diffuse lighting component values.
-
-
18. A method for rasterizing graphics primitives of a graphics image comprising:
-
determining whether each edge and span portion of the primitive includes a specular lighting component having a non-negligible value;
processing only a diffuse lighting component of each fragment of the edge and span portions determined to have a negligible specular lighting component value; and
processing in separate processing states the diffuse and specular lighting component values of each fragment of the edge and span portions determined to have a non-negligible specular lighting component value. - View Dependent Claims (19, 20)
determining whether each edge and span portion of the primitive includes a specular lighting component having a value greater than zero.
-
-
20. The method of claim 18, wherein processing in separate processing states the diffuse and specular lighting component values of each fragment of edge and span portions determined to have a non-negligible specular lighting component value comprises:
-
processing the specular lighting component for the fragment in a first processing state; and
processing the diffuse lighting component for the fragment is a second processing state;
wherein the first and second processing states are successive processing states.
-
Specification