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.

41 lines
1.1 KiB

  1. //======= Copyright � 1996-2007, Valve Corporation, All rights reserved. ======
  2. #include "common_vs_fxc.h"
  3. // This could be packed more efficiently if needed.
  4. const float4x2 cXformTexCoord0 : register( c2 );
  5. const float4x2 cXformTexCoord1 : register( c4 );
  6. const float4x2 cXformTexCoord2 : register( c6 );
  7. const float4x2 cXformTexCoord3 : register( c8 );
  8. struct VS_INPUT
  9. {
  10. float3 vPos : POSITION;
  11. float2 vBaseTexCoord : TEXCOORD0;
  12. };
  13. struct VS_OUTPUT
  14. {
  15. float4 projPos : POSITION;
  16. float4 texCoord01 : TEXCOORD0;
  17. float4 texCoord23 : TEXCOORD1;
  18. };
  19. #define texCoord0 texCoord01.xy
  20. #define texCoord1 texCoord01.zw
  21. #define texCoord2 texCoord23.xy
  22. #define texCoord3 texCoord23.zw
  23. VS_OUTPUT main( const VS_INPUT v )
  24. {
  25. VS_OUTPUT o = ( VS_OUTPUT )0;
  26. o.projPos = float4( v.vPos, 1.0f );
  27. o.texCoord0 = mul( float3( v.vBaseTexCoord, 1 ), (float3x2)cXformTexCoord0 );
  28. o.texCoord1 = mul( float3( v.vBaseTexCoord, 1 ), (float3x2)cXformTexCoord1 );
  29. o.texCoord2 = mul( float3( v.vBaseTexCoord, 1 ), (float3x2)cXformTexCoord2 );
  30. o.texCoord3 = mul( float3( v.vBaseTexCoord, 1 ), (float3x2)cXformTexCoord3 );
  31. return o;
  32. }