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.

45 lines
997 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. float4 worldPos_projPosZ : TEXCOORD7; // Necessary for pixel fog
  22. };
  23. VS_OUTPUT main( const VS_INPUT v )
  24. {
  25. VS_OUTPUT o = ( VS_OUTPUT )0;
  26. o.projPos = mul( float4( v.vPos, 1 ), cModelViewProj );
  27. float3 worldPos = mul( float4( v.vPos, 1 ), cModel[0] );
  28. o.worldPos_projPosZ = float4( worldPos.xyz, o.projPos.z );
  29. o.eyeToVertVector = worldPos - cEyePos;
  30. #if !defined( _X360 )
  31. o.fog = CalcFog( worldPos, o.projPos, g_FogType );
  32. #endif
  33. o.vertexColor = cModulationColor;
  34. return o;
  35. }