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.

52 lines
1.0 KiB

  1. //========== Copyright (c) Valve Corporation, All rights reserved. ==========//
  2. // STATIC: "VERTEXCOLOR" "0..1" [=0]
  3. // STATIC: "TRANSFORMVERTS" "0..1" [=0]
  4. #include "common_vs_fxc.h"
  5. struct VS_INPUT
  6. {
  7. float3 vPos : POSITION;
  8. float2 vBaseTexCoord : TEXCOORD0;
  9. #if VERTEXCOLOR
  10. float4 vColor : COLOR0;
  11. #endif
  12. };
  13. struct VS_OUTPUT
  14. {
  15. float4 projPos : POSITION;
  16. float2 baseTexCoord : TEXCOORD0;
  17. #if VERTEXCOLOR
  18. float4 vColor : TEXCOORD1;
  19. #endif
  20. };
  21. float4 Texel_Sizes : register (SHADER_SPECIFIC_CONST_0);
  22. VS_OUTPUT main( const VS_INPUT v )
  23. {
  24. VS_OUTPUT o = ( VS_OUTPUT )0;
  25. if ( TRANSFORMVERTS )
  26. o.projPos.xyzw = mul( float4( v.vPos.xyz, 1.0f ), cModelViewProj );
  27. else
  28. o.projPos = float4( v.vPos, 1.0f );
  29. #ifdef _PS3
  30. // Account for OpenGL's flipped y coordinate and expanded z range [-1,1] instead of [0,1]
  31. o.projPos.y = -o.projPos.y;
  32. o.projPos.z = 2.0f * o.projPos.z - o.projPos.w;
  33. #endif // _PS3
  34. o.baseTexCoord = v.vBaseTexCoord;
  35. #if ( VERTEXCOLOR )
  36. o.vColor.rgba = v.vColor.rgba;
  37. #endif
  38. return o;
  39. }