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
670 B

  1. #include "common_vs_fxc.h"
  2. // STATIC: "USESCOLOR" "0..1"
  3. struct VS_INPUT
  4. {
  5. float4 vPos : POSITION;
  6. # if (USESCOLOR == 1)
  7. float4 vColor : COLOR0;
  8. # endif
  9. };
  10. struct VS_OUTPUT
  11. {
  12. float4 vProjPos : POSITION;
  13. # if (USESCOLOR == 1)
  14. float4 vColor : COLOR0;
  15. # endif
  16. };
  17. VS_OUTPUT main( const VS_INPUT v )
  18. {
  19. VS_OUTPUT o = ( VS_OUTPUT )0;
  20. o.vProjPos.xyz = v.vPos.xyz;
  21. o.vProjPos.w = 1.0f;
  22. #ifdef _PS3
  23. // Account for OpenGL's flipped y coordinate and expanded z range [-1,1] instead of [0,1]
  24. o.vProjPos.y = -o.vProjPos.y;
  25. o.vProjPos.z = 2.0f * o.vProjPos.z - o.vProjPos.w;
  26. #endif // _PS3
  27. # if (USESCOLOR == 1)
  28. {
  29. o.vColor = v.vColor;
  30. }
  31. # endif
  32. return o;
  33. }