Counter Strike : Global Offensive Source Code
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.

40 lines
893 B

  1. #include "common_vs_fxc.h"
  2. struct VS_INPUT
  3. {
  4. float3 vPos : POSITION;
  5. float2 vBaseTexCoord : TEXCOORD0;
  6. };
  7. struct VS_OUTPUT
  8. {
  9. float4 projPos : POSITION;
  10. float2 coordTap0 : TEXCOORD0;
  11. float2 coordTap1 : TEXCOORD1;
  12. float2 coordTap2 : TEXCOORD2;
  13. float2 coordTap3 : TEXCOORD3;
  14. };
  15. float2 vsTapOffs[4] : register ( SHADER_SPECIFIC_CONST_0 );
  16. VS_OUTPUT main( const VS_INPUT v )
  17. {
  18. VS_OUTPUT o = ( VS_OUTPUT )0;
  19. o.projPos = float4( v.vPos, 1.0f );
  20. #ifdef _PS3
  21. // Account for OpenGL's flipped y coordinate and expanded z range [-1,1] instead of [0,1]
  22. o.projPos.y = -o.projPos.y;
  23. o.projPos.z = 2.0f * o.projPos.z - o.projPos.w;
  24. #endif // _PS3
  25. o.coordTap0 = v.vBaseTexCoord + vsTapOffs[0];
  26. o.coordTap1 = v.vBaseTexCoord + vsTapOffs[1];
  27. o.coordTap2 = v.vBaseTexCoord + vsTapOffs[2];
  28. o.coordTap3 = v.vBaseTexCoord + vsTapOffs[3];
  29. return o;
  30. }