Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
897 B

  1. // DYNAMIC: "COMPRESSED_VERTS" "0..1"
  2. // DYNAMIC: "SKINNING" "0..1"
  3. #include "common_vs_fxc.h"
  4. static const bool g_bSkinning = SKINNING ? true : false;
  5. const float4 cBaseTexCoordTransform[2] : register( SHADER_SPECIFIC_CONST_0 );
  6. struct VS_INPUT
  7. {
  8. float4 vPos : POSITION;
  9. float4 vBoneWeights : BLENDWEIGHT;
  10. float4 vBoneIndices : BLENDINDICES;
  11. float4 vTexCoord0 : TEXCOORD0;
  12. };
  13. struct VS_OUTPUT
  14. {
  15. float4 projPos : POSITION;
  16. float2 baseTexCoord : TEXCOORD0;
  17. };
  18. VS_OUTPUT main( const VS_INPUT v )
  19. {
  20. VS_OUTPUT o = ( VS_OUTPUT )0;
  21. float3 worldPos;
  22. SkinPosition( g_bSkinning, v.vPos, v.vBoneWeights, v.vBoneIndices, worldPos );
  23. float4 projPos = mul( float4( worldPos, 1 ), cViewProj );
  24. o.projPos = projPos;
  25. o.baseTexCoord.x = dot( v.vTexCoord0, cBaseTexCoordTransform[0] );
  26. o.baseTexCoord.y = dot( v.vTexCoord0, cBaseTexCoordTransform[1] );
  27. return o;
  28. }