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.

42 lines
867 B

  1. // DYNAMIC: "DOWATERFOG" "0..1"
  2. //====== Copyright � 1996-2004, Valve Corporation, All rights reserved. =======
  3. //
  4. // Purpose:
  5. //
  6. //=============================================================================
  7. #include "common_vs_fxc.h"
  8. static const int g_FogType = DOWATERFOG;
  9. struct VS_INPUT
  10. {
  11. float3 vPos : POSITION;
  12. };
  13. struct VS_OUTPUT
  14. {
  15. float4 projPos : POSITION;
  16. #if !defined( _X360 )
  17. float fog : FOG;
  18. #endif
  19. float3 eyeToVertVector : TEXCOORD0;
  20. float4 vertexColor : COLOR;
  21. };
  22. VS_OUTPUT main( const VS_INPUT v )
  23. {
  24. VS_OUTPUT o = ( VS_OUTPUT )0;
  25. o.projPos = mul( float4( v.vPos, 1 ), cModelViewProj );
  26. float3 worldPos = mul( float4( v.vPos, 1 ), cModel[0] );
  27. o.eyeToVertVector = worldPos - cEyePos;
  28. #if !defined( _X360 )
  29. o.fog = CalcFog( worldPos, o.projPos, g_FogType );
  30. #endif
  31. o.vertexColor = cModulationColor;
  32. return o;
  33. }