#include "..\..\VertexShader.h" ;------------------------------------------------------------------------------ ; Defines ;------------------------------------------------------------------------------ #define C_LIGHT_POSITION c10 #define C_INVERSE_RADIUS c11 #define C_HALF c12 ;------------------------------------------------------------------------------ ; Texture coordinates ;------------------------------------------------------------------------------ ; Calculate the vertex-to-light vector add rVertexToLight, C_LIGHT_POSITION, -pPos ; For light attenuation, store scaled and biased vertex-to-light vector in texture stages mul rTemp, rVertexToLight, C_INVERSE_RADIUS mad oT0.xy, rTemp.xy, C_HALF, C_HALF mad oT1.x, rTemp.z, C_HALF, C_HALF mov oT1.y, C_HALF ; Transform L vector into texture space and store as a texture stage dp3 oT2.x, rVertexToLight, pBasisU dp3 oT2.y, rVertexToLight, pBasisV dp3 oT2.z, rVertexToLight, pNormal ; Last texture stage is the normal map mul oT3.xy, vTexCoords, C_TEXCOORD_DECOMPRESS