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.

26 lines
629 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 baseTexCoord : TEXCOORD0; // Base texture coordinate
  7. float4 vColor : TEXCOORD1;
  8. };
  9. float4 main( PS_INPUT i ) : COLOR
  10. {
  11. // Read PC sRGB color without using the HW sRGB read
  12. float4 vTextureColor = tex2D( TexSampler, i.baseTexCoord );
  13. // Do a PC sRGB gamma->linear conversion
  14. vTextureColor.rgb = SrgbGammaToLinear( vTextureColor.rgb );
  15. float4 result;
  16. result.rgb = vTextureColor.rgb * i.vColor.rgb;
  17. result.a = i.vColor.a;
  18. return result;
  19. }