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.

50 lines
878 B

  1. // DYNAMIC: "DOWATERFOG" "0..1"
  2. #include "common_vs_fxc.h"
  3. static const int g_FogType = DOWATERFOG;
  4. struct VS_INPUT
  5. {
  6. float4 vPos : POSITION;
  7. float2 vTexCoord1 : TEXCOORD1;
  8. };
  9. struct VS_OUTPUT
  10. {
  11. float4 vProjPos : POSITION;
  12. float2 vTexCoord0 : TEXCOORD0;
  13. float2 vTexCoord1 : TEXCOORD1;
  14. float4 vDiffuse : COLOR0;
  15. float4 fogFactorW : COLOR1;
  16. #if !defined( _X360 )
  17. float fog : FOG;
  18. #endif
  19. };
  20. VS_OUTPUT main( const VS_INPUT v )
  21. {
  22. VS_OUTPUT o = ( VS_OUTPUT )0;
  23. float3 worldPos;
  24. worldPos = mul4x3( v.vPos, cModel[0] );
  25. o.vProjPos = mul( float4( worldPos, 1 ), cViewProj );
  26. o.fogFactorW = CalcFog( worldPos, o.vProjPos, g_FogType );
  27. #if !defined( _X360 )
  28. o.fog = o.fogFactorW;
  29. #endif
  30. // YUCK! This is to make texcoords continuous for mat_softwaretl
  31. o.vTexCoord0 = 0.0f;
  32. o.vTexCoord1 = v.vTexCoord1;
  33. o.vDiffuse = 1.0f;
  34. return o;
  35. }