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.

45 lines
1.3 KiB

  1. //========== Copyright (c) Valve Corporation, All rights reserved. ==========//
  2. //
  3. // Vertex shader to pass through texcoords needed to run the
  4. // procedural glint generation inner loop in the pixel shader
  5. //
  6. // $Header: $
  7. // $NoKeywords: $
  8. //===========================================================================//
  9. #include "common_vs_fxc.h"
  10. struct VS_INPUT
  11. {
  12. float3 vPos : POSITION;
  13. float2 tc : TEXCOORD0; // Interpolated coordinate of current texel in 3x3 quad
  14. float2 glintCenter : TEXCOORD1; // Uniform value containing center of glint in local 3x3 quad
  15. float3 glintColor : TEXCOORD2; // Uniform value of color of glint
  16. };
  17. struct VS_OUTPUT
  18. {
  19. float4 projPos : POSITION;
  20. float2 tc : TEXCOORD0; // Interpolated coordinate of current texel in 3x3 quad
  21. float2 glintCenter : TEXCOORD1; // Uniform value containing center of glint in local 3x3 quad
  22. float3 glintColor : TEXCOORD2; // Uniform value of color of glint
  23. };
  24. VS_OUTPUT main( const VS_INPUT v )
  25. {
  26. VS_OUTPUT o = ( VS_OUTPUT )0;
  27. o.projPos = float4( v.vPos, 1.0f );
  28. #ifdef _PS3
  29. // Account for OpenGL's flipped y coordinate and expanded z range [-1,1] instead of [0,1]
  30. o.projPos.y = -o.projPos.y;
  31. o.projPos.z = 2.0f * o.projPos.z - o.projPos.w;
  32. #endif // _PS3
  33. o.tc = v.tc;
  34. o.glintCenter = v.glintCenter;
  35. o.glintColor = v.glintColor;
  36. return o;
  37. }