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" ;------------------------------------------------------------------------------ ; Defines ;------------------------------------------------------------------------------ #define C_EYE_POSITION c10 #define C_SPECULAR_POWER c11 ;------------------------------------------------------------------------------ ; Diffuse color ;------------------------------------------------------------------------------ ; Initialize specular light mov rFinalDiffuse, C_ZERO ; Calculate normalized eye vector add rVertexToEye, C_EYE_POSITION, -pPos NormalizeVector(rVertexToEye) ; Store specular power in light coefficient vector mov rLightCoeff.w, C_SPECULAR_POWER.x ; Add specular point lights AddSpecularPointLight(C_LIGHT_POSITION_1, C_LIGHT_COLOR_1, C_LIGHT_ATTEN_1, rFinalDiffuse) AddSpecularPointLight(C_LIGHT_POSITION_2, C_LIGHT_COLOR_2, C_LIGHT_ATTEN_2, rFinalDiffuse) AddSpecularPointLight(C_LIGHT_POSITION_3, C_LIGHT_COLOR_3, C_LIGHT_ATTEN_3, rFinalDiffuse) AddSpecularPointLight(C_LIGHT_POSITION_4, C_LIGHT_COLOR_4, C_LIGHT_ATTEN_4, rFinalDiffuse) AddSpecularPointLight(C_LIGHT_POSITION_5, C_LIGHT_COLOR_5, C_LIGHT_ATTEN_5, rFinalDiffuse) ; Combine final specular light and material color mul oD0.xyz, rFinalDiffuse, C_MATERIAL_COLOR #ifdef _PCBUILD mov oD0.w, C_ONE #endif #include "..\..\VertexShader.h" ;------------------------------------------------------------------------------ ; Fog calculation ;------------------------------------------------------------------------------ ; Calculate fog factor and copy to fog register CalculateLayeredFog(pPos, oFog) #include "..\..\VertexShader.h" ;------------------------------------------------------------------------------ ; Texture coordinates ;------------------------------------------------------------------------------ ; Copy 1 set of texture coordinates mul oT0.xy, vTexCoords, C_TEXCOORD_DECOMPRESS