vs_2_0 dcl_position v0 dcl_normal v1 dcl_texcoord0 v3 dcl_texcoord6 v14 dcl_texcoord7 v15 dcl_position1 v6 dcl_normal1 v10 dcl_position2 v7 dcl_normal2 v11 dcl_position3 v8 dcl_normal3 v12 dcl_position4 v9 dcl_normal4 v13 #include "../../VertexShader.h" ;------------------------------------------------------------------------------ ; Geometry transform ;------------------------------------------------------------------------------ ; Calculate bone indices mad r7, vIndices, c23.x, c23.y ; Sum weighted blendshape position deltas mul rTemp, vBlend0, c24.x mad rTemp, vBlend1, c24.y, rTemp mad rTemp, vBlend2, c24.z, rTemp mad rTemp, vBlend3, c24.w, rTemp mad rTemp.xyz, c26.x, rTemp, vPos mov rTemp.w, C_ONE ; Skin position by bone 0 MOVA a0.x, r7.x m4x3 r0.xyz, rTemp, c[a0.x] mul pPos.xyz, r0.xyz, vWeights.xxx ; Calculate the second bone weight from the first sub r8.x, C_ONE, vWeights.x ; Skin position by bone 1 MOVA a0.x, r7.y m4x3 r0.xyz, rTemp, c[a0.x] mad pPos.xyz, r0.xyz, r8.x, pPos mov pPos.w, C_ONE ; Sum weighted blendshape normal deltas mul rTemp, vBlendNorm0, c25.x mad rTemp, vBlendNorm1, c25.y, rTemp mad rTemp, vBlendNorm2, c25.z, rTemp mad rTemp, vBlendNorm3, c25.w, rTemp mad rTemp, c26.x, rTemp, vNormal ; Skin normal by bone 0 MOVA a0.x, r7.x m3x3 pNormal.xyz, rTemp, c[a0.x] NormalizeVector(pNormal) ; Transform skinned position to projection space m4x4 OPOS, pPos, C_PROJECTION_MATRIX FIXUP_OPOS #include "..\..\VertexShader.h" ;------------------------------------------------------------------------------ ; Defines ;------------------------------------------------------------------------------ #define C_EYE_POSITION c10 ;------------------------------------------------------------------------------ ; Diffuse color ;------------------------------------------------------------------------------ ; Compute the normalized vertex to eye vector add rVertexToEye, C_EYE_POSITION, -pPos NormalizeVector(rVertexToEye) ; Dot with vertex normal and take absolute value dp3 rLightCoeff.x, pNormal, rVertexToEye max rLightCoeff.x, rLightCoeff.x, -rLightCoeff.x max rLightCoeff.x, rLightCoeff.x, C_ZERO.x ; Modulate with constant diffuse color mul oD0.rgb, rLightCoeff.x, C_MATERIAL_COLOR mov oD0.a, C_MATERIAL_COLOR #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