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.

55 lines
1.3 KiB

  1. //========== Copyright (c) Valve Corporation, All rights reserved. ==========//
  2. #include "common_vs_fxc.h"
  3. struct VS_INPUT
  4. {
  5. float3 vPos : POSITION;
  6. float2 vBaseTexCoord : TEXCOORD0;
  7. float4 lightColor_InnerCos : TEXCOORD1;
  8. float4 lightDir_OuterCos : TEXCOORD2;
  9. float3 lightOrigin : TEXCOORD3;
  10. float4 attnInfo : TEXCOORD4;
  11. float3 col : TEXCOORD5;
  12. };
  13. struct VS_OUTPUT
  14. {
  15. float4 projPos : POSITION;
  16. float2 texCoord : TEXCOORD0;
  17. float4 lightColor_InnerCos : TEXCOORD1;
  18. float4 lightDir_OuterCos : TEXCOORD2;
  19. float3 lightOrigin : TEXCOORD3;
  20. float4 attnInfo : TEXCOORD4;
  21. float3 SampleXYW : TEXCOORD5;
  22. float3 col : TEXCOORD6;
  23. };
  24. float4 Texel_Sizes : register (SHADER_SPECIFIC_CONST_0);
  25. VS_OUTPUT main( const VS_INPUT v )
  26. {
  27. VS_OUTPUT o;
  28. o.projPos = float4( v.vPos, 1.0f );
  29. //o.projPos.xyzw = mul( float4( v.vPos.xyz, 1.0f ), cModelViewProj );
  30. float2 vSamplePos;
  31. vSamplePos.x = o.projPos.x;
  32. vSamplePos.y = -o.projPos.y; // invert Y
  33. vSamplePos = (vSamplePos + o.projPos.w) * 0.5f;
  34. o.SampleXYW = float3( vSamplePos.x, vSamplePos.y, o.projPos.w );
  35. o.texCoord = v.vBaseTexCoord;
  36. o.lightColor_InnerCos = v.lightColor_InnerCos;
  37. o.lightDir_OuterCos = v.lightDir_OuterCos;
  38. o.lightOrigin = v.lightOrigin;
  39. o.col = v.col;
  40. o.attnInfo = v.attnInfo;
  41. return o;
  42. }