摘要 |
<p>A method for performing tangent space lighting in a deferred shading graphics processor (DSGP) encompassing blocks that preprocess data and a Phong shader that executes all prepocessed fragments. A preprocessor block receives texture maps in a variety of formats and converts those maps to a format useable by the Phong shader. Preprocessor blocks provide the Phong shader with interpolated surface basis vectors, a vector Tb that represents bump data in object space and other data to perform lighting and bump mapping computations for each fragment that needs lighting effects computed. The Phong shader performs all lighting computations in eye space, requiring it to transform bump data from tangent space to eye space by multiplying a matrix M comprising eye space basis vectors derived from surface basis vectors and the vector Tb. The basis vectors are derived by the DSGP preprocessor so the multiplication (M x Tb) gives the perturbed surface normal N' in eye space, reflecting the bump effects. N' is used in lighting computations.</p> |