vs_2_0 dcl_position v0 dcl_normal v1 dcl_texcoord0 v3 #include "..\..\VertexShader.h" ;------------------------------------------------------------------------------ ; Geometry transform ;------------------------------------------------------------------------------ ; Copy model-space geometry to pipeline registers mov pPos, vPos mov pNormal, vNormal ; Transform position to projection space m4x4 OPOS, vPos, C_PROJECTION_MATRIX FIXUP_OPOS #include "..\..\VertexShader.h" ;------------------------------------------------------------------------------ ; Diffuse color ;------------------------------------------------------------------------------ ; Initialize diffuse color mov oD0, C_MATERIAL_COLOR #include "..\..\VertexShader.h" ;------------------------------------------------------------------------------ ; Fog calculation ;------------------------------------------------------------------------------ #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 ; Store L vector as a texture stage mov oT2, rVertexToLight ; Store N vector in the specular channel mad oD1.xyz, pNormal, C_HALF, C_HALF #ifdef _PCBUILD mov oD1.w, C_ONE #endif ; Copy texcoords for base texture mul oT3.xy, vTexCoords, C_TEXCOORD_DECOMPRESS