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.

37 lines
1.0 KiB

  1. #include "common_vs_fxc.h"
  2. const float4 g_matBaseTexCoordTransform[2] : register( SHADER_SPECIFIC_CONST_0 );
  3. const float4 g_matCloudTexCoordTransform[2] : register( SHADER_SPECIFIC_CONST_2 );
  4. struct VS_INPUT
  5. {
  6. float4 vPos : POSITION;
  7. float4 vTexCoord0 : TEXCOORD0;
  8. float4 vTexCoord1 : TEXCOORD1;
  9. };
  10. struct VS_OUTPUT
  11. {
  12. float4 projPos : POSITION;
  13. float2 baseCoords : TEXCOORD0;
  14. float2 cloudAlphaCoords : TEXCOORD1;
  15. float fogFactor : TEXCOORD2;
  16. };
  17. VS_OUTPUT main( const VS_INPUT v )
  18. {
  19. VS_OUTPUT o;
  20. o.projPos = mul( v.vPos, cModelViewProj );
  21. // Compute fog based on the position
  22. float3 vWorldPos = mul( v.vPos, cModel[0] );
  23. o.fogFactor = CalcFog( vWorldPos, o.projPos, FOGTYPE_RANGE );
  24. // Texture coordinate transforms
  25. o.baseCoords.x = dot( v.vTexCoord0.xyzw, g_matBaseTexCoordTransform[0] );
  26. o.baseCoords.y = dot( v.vTexCoord0.xyzw, g_matBaseTexCoordTransform[1] );
  27. o.cloudAlphaCoords.x = dot( v.vTexCoord1.xyzw, g_matCloudTexCoordTransform[0] );
  28. o.cloudAlphaCoords.y = dot( v.vTexCoord1.xyzw, g_matCloudTexCoordTransform[1] );
  29. return o;
  30. }