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.

30 lines
724 B

  1. //========== Copyright (c) Valve Corporation, All rights reserved. ==========//
  2. #include "common_ps_fxc.h"
  3. sampler TexSampler : register( s0 );
  4. struct PS_INPUT
  5. {
  6. float2 coordTap0 : TEXCOORD0;
  7. float2 coordTap1 : TEXCOORD1;
  8. float2 coordTap2 : TEXCOORD2;
  9. float2 coordTap3 : TEXCOORD3;
  10. };
  11. float4 main( PS_INPUT i ) : COLOR
  12. {
  13. float4 s0, s1, s2, s3;
  14. // Sample 4 taps
  15. s0 = tex2D( TexSampler, i.coordTap0 );
  16. s1 = tex2D( TexSampler, i.coordTap1 );
  17. s2 = tex2D( TexSampler, i.coordTap2 );
  18. s3 = tex2D( TexSampler, i.coordTap3 );
  19. // store grayscale version of buffer in alpha
  20. float4 vResult = ( s0 + s1 + s2 + s3 ) * 0.25f;
  21. vResult.a = dot( float3( 0.3f, 0.59f, 0.11f ), vResult.rgb );
  22. return vResult;
  23. }