摘要 |
A method and apparatus for shading polygons in a graphics rendering system is provided. The method includes the step of providing, for each polygon to be shaded, a polygon coordinate system defined by three normalized vectors which represent the X, Y and Z axes. A light source defining a three dimensional light direction vector is further provided. The three dimensional light vector is rotated to correspond with the polygon direction vector. The rotated three dimensional light vector is converted into a two dimensional vector whose length is proportional to the angle between the polygon Z vector and the light direction vector. Another aspect of the present invention involves the interpolation of two dimensional vertex angle values, provided for each of the polygon's vertices, at each drawn pixel within the polygon surface. A bump map vector value is added to the interpolated vertex value forming a two dimensional composite surface angle vector. Light coefficients are then derived from the distance between the composite surface angle vector and the two dimensional light vectors.
|