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.

31 lines
864 B

  1. //======= Copyright � 1996-2006, Valve Corporation, All rights reserved. ======
  2. #define CONVERT_TO_SRGB 0
  3. #include "common_ps_fxc.h"
  4. sampler TexSampler : register( s0 );
  5. struct PS_INPUT
  6. {
  7. float2 baseTexCoord : TEXCOORD0; // Base texture coordinate
  8. #if defined( _X360 ) //matching pixel shader inputs to vertex shader outputs to avoid shader patches
  9. float2 ZeroTexCoord : TEXCOORD1;
  10. float2 bloomTexCoord : TEXCOORD2;
  11. #endif
  12. float4 vColor : TEXCOORD3;
  13. };
  14. float4 main( PS_INPUT i ) : COLOR
  15. {
  16. float4 vTextureColor = tex2D( TexSampler, i.baseTexCoord );
  17. vTextureColor.r = SrgbGammaToLinear( vTextureColor.r );
  18. vTextureColor.g = SrgbGammaToLinear( vTextureColor.g );
  19. vTextureColor.b = SrgbGammaToLinear( vTextureColor.b );
  20. float4 result;
  21. result.rgb = vTextureColor.rgb * i.vColor.rgb;
  22. result.a = i.vColor.a;
  23. return result;
  24. }