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.

46 lines
860 B

  1. // DYNAMIC: "DOWATERFOG" "0..1"
  2. // DYNAMIC: "SKINNING" "0..1"
  3. #include "common_vs_fxc.h"
  4. static const int g_FogType = DOWATERFOG;
  5. static const bool g_bSkinning = SKINNING ? true : false;
  6. struct VS_INPUT
  7. {
  8. float4 vPos : POSITION;
  9. float4 vBoneWeights : BLENDWEIGHT;
  10. float4 vBoneIndices : BLENDINDICES;
  11. };
  12. struct VS_OUTPUT
  13. {
  14. float4 vProjPos : POSITION;
  15. float4 vDiffuse : COLOR0;
  16. float4 fogFactorW : COLOR1;
  17. #if !defined( _X360 )
  18. float fog : FOG;
  19. #endif
  20. };
  21. VS_OUTPUT main( const VS_INPUT v )
  22. {
  23. VS_OUTPUT o = ( VS_OUTPUT )0;
  24. float3 worldPos;
  25. SkinPosition( g_bSkinning, v.vPos, v.vBoneWeights, v.vBoneIndices, worldPos );
  26. o.vProjPos = mul( float4( worldPos, 1 ), cViewProj );
  27. o.fogFactorW = CalcFog( worldPos, o.vProjPos, g_FogType );
  28. #if !defined( _X360 )
  29. o.fog = o.fogFactorW;
  30. #endif
  31. o.vDiffuse = 1.0f;
  32. return o;
  33. }