Method for implementing the power function DP and computer graphics system employing the same
First Claim
1. A power function device for computing a value DP, wherein a logarithm base two of the value, log2 (DP), is expressible as the combination of an integer portion I, a fixed precision fractional portion F, and a remainder portion R, and wherein the power function device comprises:
- an adder coupled to receive the remainder portion R, wherein the adder is configured to add a predetermined constant to the remainder portion R to produce a first factor;
a lookup table coupled to receive the fixed-precision fractional portion F and configured to responsively provide a second factor;
a multiplier coupled to receive the first factor, wherein the multiplier is further coupled to receive the second factor, and wherein the multiplier is configured to produce a product of the first and second factors; and
a shift unit coupled to receive the product, wherein the shift unit is further coupled to receive the integer portion I, and wherein the shift unit is configured to shift the product according to the integer portion I to produce the value DP.
2 Assignments
0 Petitions
Accused Products
Abstract
A graphics accelerator using an improved method for evaluating a power function. As part of determining realistic shading for objects in a three-dimensional scene, the Phong technique requires repeated evaluation of the power function DP, where D is a base value and P is a power value with a fractional component. In one embodiment, a hardware implementation of this function determines the logarithm log2 (DP) using a table lookup and a multiplication. An anti-logarithm function is then performed as follows. The logarithm log2 (DP) is split into three parts: an integer portion I, a five bit fractional portion F, and a remainder fractional portion R. The desired value DP is then expressible as 2I 2F 2R. The factor 2F In2 is found using a 32-entry lookup table. The factor 2R /In2 is closely approximated by adding 1/In2 to R. Multiplying these two factors and shifting by I bits advantageously produces the desired value DP.
22 Citations
15 Claims
-
1. A power function device for computing a value DP, wherein a logarithm base two of the value, log2 (DP), is expressible as the combination of an integer portion I, a fixed precision fractional portion F, and a remainder portion R, and wherein the power function device comprises:
-
an adder coupled to receive the remainder portion R, wherein the adder is configured to add a predetermined constant to the remainder portion R to produce a first factor; a lookup table coupled to receive the fixed-precision fractional portion F and configured to responsively provide a second factor; a multiplier coupled to receive the first factor, wherein the multiplier is further coupled to receive the second factor, and wherein the multiplier is configured to produce a product of the first and second factors; and a shift unit coupled to receive the product, wherein the shift unit is further coupled to receive the integer portion I, and wherein the shift unit is configured to shift the product according to the integer portion I to produce the value DP. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A computer graphics generation system comprising:
-
an interface module coupled to a bus for receiving image information; a computation module coupled to receive said image information from the interface module, wherein the computation module is configured to determine realistic lighting effects based on said image information, wherein said realistic lighting effects are produced with a power function DP, wherein D is a base value and P is a power value, wherein a logarithm log2 (DP) is expressible as the combination of an integer portion I, a fixed precision fractional portion F, and a remainder portion R, and wherein the computation module comprises; an adder coupled to receive the remainder portion R, wherein the adder is configured to add a predetermined constant to the remainder portion R to produce a first factor; a lookup table coupled to receive the fixed-precision fractional portion F and configured to responsively provide a second factor; a multiplier coupled to receive the first factor, wherein the multiplier is further coupled to receive the second factor, and wherein the multiplier is configured to produce a product of the first and second factors; and a shift unit coupled to receive the product, wherein the shift unit is further coupled to receive the integer portion I, and wherein the shift unit is configured to shift the product according to the integer portion I to produce a result of the power function DP ; a draw module coupled to receive the image information with the realistic lighting effects from the computation module, wherein the draw module is configured to responsively produce pixel data; and an analog-to-digital converter coupled to receive the pixel data and configured to convert the pixel data into an analog video signal. - View Dependent Claims (9, 10, 11, 12)
-
-
13. A method for determining a power function value DP from a base value D and a power value P, wherein the method comprises:
-
receiving the base value D; determining a logarithm log2 D using a logarithm lookup table; receiving the power value P; multiplying the logarithm log2 D determined from the logarithm lookup table with the power value P to produce a logarithm log2 (DP) having an integer value I, a fixed-precision fractional value F, and a remainder value R; adding 1/ln2 to the remainder value R to produce a first factor substantially equal to 2R /ln2; applying the fixed-precision fractional value F to an anti-log lookup table to produce a second factor substantially equal to 2F ln2; multiplying the first factor with the second factor to produce a product substantially equal to 2F+R ; and shifting the product by a number of positions indicated by the integer value I to produce the power function value DP. - View Dependent Claims (14, 15)
-
Specification