Rapid computation of local eye vectors in a fixed point lighting unit
First Claim
1. A method for calculating a local eye vector in a fixed point lighting unit, wherein said local eye vector corresponds to a given eye position and a first vertex of a given triangle primitive, wherein said given triangle primitive is to be projected into a given viewport, said method comprising:
- generating a view vector matrix which corresponds to said given eye position and corner coordinates of said given viewport, wherein said corner coordinates are screen space coordinates, and wherein said view vector matrix is usable to map screen space coordinates to an eye vector space corresponding to said given viewport;
receiving a first set of coordinates corresponding to said first vertex, wherein said first set of coordinates are screen space coordinates;
scaling said first set of coordinates to a numeric range representable by said fixed point lighting unit;
transforming said first set of coordinates using said view vector matrix, wherein said transforming produces a non-normalized local eye vector, wherein said non-normalized local eye vector is usable to perform lighting computations.
2 Assignments
0 Petitions
Accused Products
Abstract
A rapid method for calculating a local eye vector in a fixed point lighting unit. For a given triangle primitive which is to be projected into a given viewport in screen space coordinates, the local eye vector corresponds to a given eye position and a first vertex of the given triangle primitive. (A different local eye vector is calculated for each vertex of the given triangle primitive). The method first comprises generating a view vector matrix which corresponds to the given eye position and corner coordinates of the given viewport, where the corner coordinates are expressed in screen space coordinates. The view vector matrix is usable to map screen space coordinates to an eye vector space which corresponds to the given viewport. The method next includes receiving a first set of coordinates (in screen space) which correspond to the first vertex. The first set of coordinates are then scaled to a numeric range which is representable by the fixed point lighting unit. Next, the first set of coordinates are transformed using the view vector matrix, which produces a non-normalized local eye vector within the eye vector space for the given viewport. The non-normalized local eye vector is normalized to form a normalized local eye vector. The normalized local eye vector is then usable to perform subsequent lighting computations such as computation of specular reflection values for infinite light sources, producing more realistic lighting effects than if an infinite eye vector were used. These more realistic lighting effects do not come at decreased performance, however, as the local eye vector may be calculated rapidly using this method.
82 Citations
23 Claims
-
1. A method for calculating a local eye vector in a fixed point lighting unit, wherein said local eye vector corresponds to a given eye position and a first vertex of a given triangle primitive, wherein said given triangle primitive is to be projected into a given viewport, said method comprising:
-
generating a view vector matrix which corresponds to said given eye position and corner coordinates of said given viewport, wherein said corner coordinates are screen space coordinates, and wherein said view vector matrix is usable to map screen space coordinates to an eye vector space corresponding to said given viewport; receiving a first set of coordinates corresponding to said first vertex, wherein said first set of coordinates are screen space coordinates; scaling said first set of coordinates to a numeric range representable by said fixed point lighting unit; transforming said first set of coordinates using said view vector matrix, wherein said transforming produces a non-normalized local eye vector, wherein said non-normalized local eye vector is usable to perform lighting computations. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
-
-
16. A method for generating a view vector matrix for a given eye position, wherein said view vector matrix is usable to transform a first vertex of a given triangle primitive from screen space coordinates to world space coordinates, wherein said given triangle primitive is within a given viewport, said method comprising:
-
generating an inverse matrix from a current viewing matrix, wherein said current viewing matrix is usable to transform vertices from world space coordinates to screen space coordinates; calculating world coordinates for said given eye position from said inverse matrix; calculating world space coordinates for corner coordinates of said given viewport using said inverse matrix and clip space coordinates of said given viewport; normalizing said world space coordinates for said corner coordinates of said given viewport, thereby producing normalized world space corner coordinates; normalizing said world space coordinates for said given eye position, thereby producing normalized world space eye coordinates; generating a plurality of vectors in world space coordinates from said normalized world space eye coordinates to each of said normalized world space corner coordinates; normalizing said plurality of vectors to a front clipping plane of said given viewport; determining the size of a projection of said plurality of vectors on to said given viewport; determining a center offset of said projection; determining the size of said given viewport and a center offset of said given viewport in screen space coordinates, wherein said size of said given viewport and said center offset of said given viewport are adjusted to a given numeric range; computing non-normalized view vector matrix components from said size of said projection, said center offset of said projection, said size of said given viewport, and said center offset of said given viewport; computing maximum input values to said view vector matrix; determining a maximum view vector length by transforming said maximum input values using said non-normalized view vector matrix components; scaling said non-normalized view vector matrix components to keep said maximum vector length within a predetermined range, thereby producing final view vector matrix component values. - View Dependent Claims (17, 18, 19, 20)
-
-
21. A fixed point lighting unit for calculating a local eye vector, wherein said local eye vector corresponds to a given eye position and a first vertex of a given triangle primitive, wherein said given triangle primitive is to be projected into a given viewport, said fixed point lighting unit comprising:
-
a plurality of memory locations configured to store components of a view vector matrix, is calculated from said corner coordinates of said given viewport and an inverse matrix of a current viewing matrix, wherein said current viewing matrix is usable to transform vertices from world space coordinates to screen space coordinates, wherein said current viewing matrix is dependent upon said given eye position; an input vertex coordinate buffer configured to receive a first set of coordinates corresponding to said first vertex, wherein said first set of coordinates are screen space coordinates, wherein said fixed point lighting unit is configured to scale said first set of coordinates to a numeric range representable by said fixed point lighting unit; a fixed point arithmetic unit configured to transform said first set of coordinates under control of a first lighting routine, thereby producing a non-normalized local eye vector, wherein said first lighting routine includes using said view vector matrix, and wherein said non-normalized local eye vector is usable to perform lighting computations. - View Dependent Claims (22, 23)
-
Specification