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.

38 lines
849 B

  1. #include "common_fog_vs_fxc.h"
  2. // DYNAMIC: "COMPRESSED_VERTS" "0..1"
  3. // DYNAMIC: "SKINNING" "0..1"
  4. #include "common_vs_fxc.h"
  5. static const int g_FogType = DOWATERFOG;
  6. static const bool g_bSkinning = SKINNING ? true : false;
  7. struct VS_INPUT
  8. {
  9. float4 vPos : POSITION;
  10. float4 vBoneWeights : BLENDWEIGHT;
  11. float4 vBoneIndices : BLENDINDICES;
  12. };
  13. struct VS_OUTPUT
  14. {
  15. float4 vProjPos : POSITION;
  16. };
  17. VS_OUTPUT main( const VS_INPUT v )
  18. {
  19. VS_OUTPUT o = ( VS_OUTPUT )0;
  20. float3 worldPos;
  21. SkinPosition( g_bSkinning, v.vPos, v.vBoneWeights, v.vBoneIndices, worldPos );
  22. o.vProjPos = mul( float4( worldPos, 1 ), cViewProj );
  23. #ifdef _PS3
  24. // Account for OpenGL's flipped y coordinate and expanded z range [-1,1] instead of [0,1]
  25. o.vProjPos.y = -o.vProjPos.y;
  26. o.vProjPos.z = 2.0f * o.vProjPos.z - o.vProjPos.w;
  27. #endif // _PS3
  28. return o;
  29. }