vs_2_0 dcl_position v0 dcl_normal v1 dcl_color v2 dcl_texcoord0 v3 dcl_texcoord1 v4 dcl_tangent v7 dcl_binormal v8 dcl_texcoord4 v9 #include "..\..\VertexShader.h" ;------------------------------------------------------------------------------ ; Geometry transform ;------------------------------------------------------------------------------ ; Copy model-space geometry to pipeline registers mov pPos, vPos mov pNormal, vNormal ; Copy model-space basis vectors to pipeline registers mov pBasisU, vBasisU mov pBasisV, vBasisV ; Transform position to projection space m4x4 OPOS, vPos, C_PROJECTION_MATRIX FIXUP_OPOS #include "..\..\VertexShader.h" ;------------------------------------------------------------------------------ ; Diffuse color ;------------------------------------------------------------------------------ ; Combine vertex color and material color mul oD0, vDiffuse, C_MATERIAL_COLOR #include "..\..\VertexShader.h" ;------------------------------------------------------------------------------ ; Fog calculation ;------------------------------------------------------------------------------ ; Calculate fog factor and copy to fog register CalculateLayeredFog(pPos, oFog) #include "..\..\VertexShader.h" ;------------------------------------------------------------------------------ ; Texture coordinates ;------------------------------------------------------------------------------ ; Base texture is the normal map mul oT0.xy, vTexCoords, C_TEXCOORD_DECOMPRESS ; Transform light direction into texture space and store as a texture stage mov rTemp, vLightDir dp3 oT1.x, rTemp, vBasisU dp3 oT1.y, rTemp, vBasisV dp3 oT1.z, rTemp, vNormal ; Copy light map coords from UV set 1 mul oT2.xy, vTexCoords1, C_TEXCOORD_DECOMPRESS