摘要 |
A method and apparatus for approximating a value distributed between two endpoints. The method and apparatus are embodied in a rendering device for calculating pixel shading values for the display of 3-D graphical images. The method approximates a function P(w)=(1-w)A+wB, where w is a provided interpolation weight between 0 and 1, A is a first endpoint value and B is a second endpoint value. The method causes exact evaluation for the cases where P(0)=A and P(1)=B. The method is comprised generally of the steps of: providing an interpolation weight value W comprised of N bit values; assigning a first predetermined pattern of N bits (J) to cause said first extreme parameter value A to be generated and a second predetermined pattern of N bits (K) to cause the second extreme parameter value B to be generated; assigning a third predetermined pattern of N bits (L) as a saturation multiplier, performing a linear interpolation to derive a parameter value for a pixel P, using a function ((J-W)A+WB); and adding a saturation value according to the criteria that if W is less than a saturation threshold, adding the quantity (LxA) to the result; or if W is greater than or equal to the saturation threshold, adding the quantity (LxB) to the result. The apparatus is comprised of a plurality of multiplexors, carry-save adders and a carry-propagate adder.
|