Team Fortress 2 Source Code as on 22/4/2020
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.

32 lines
734 B

  1. #include "common_vs_fxc.h"
  2. struct VS_INPUT
  3. {
  4. float3 vPos : POSITION;
  5. float2 vInputImageCoord : TEXCOORD0;
  6. };
  7. struct VS_OUTPUT
  8. {
  9. float4 projPos : POSITION;
  10. float2 InputImageCoord : TEXCOORD0;
  11. float2 FilmGrainCoord : TEXCOORD1;
  12. };
  13. //
  14. const float4 cFilmGrainOffset : register( SHADER_SPECIFIC_CONST_0 ); // should be SHADER_SPECIFIC_CONST_0
  15. VS_OUTPUT main( const VS_INPUT v )
  16. {
  17. VS_OUTPUT o = ( VS_OUTPUT )0;
  18. // Just copy these through to the output...
  19. o.projPos = float4( v.vPos, 1.0f );
  20. o.InputImageCoord = v.vInputImageCoord;
  21. // Scale and bias the input coordinates to get grain coordinates
  22. o.FilmGrainCoord.xy = v.vInputImageCoord.xy * cFilmGrainOffset.xy + cFilmGrainOffset.zw;
  23. return o;
  24. }