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.

32 lines
744 B

  1. //========== Copyright (c) Valve Corporation, All rights reserved. ==========//
  2. // DYNAMIC: "ISFLOAT" "0..1"
  3. #include "common_ps_fxc.h"
  4. sampler TexSampler0 : register( s0 );
  5. sampler TexSampler1 : register( s1 );
  6. struct PS_INPUT
  7. {
  8. float2 tc : TEXCOORD0;
  9. };
  10. const float4 bloomamount : register( c0 );
  11. float4 main( PS_INPUT i ) : COLOR
  12. {
  13. float4 c0 = tex2D( TexSampler0, i.tc ); // Bloom texture
  14. float4 c1 = tex2D( TexSampler1, i.tc ); // Base texture
  15. float4 result = c0 + bloomamount.xxxx * c1; // And some fraction of bloom to base
  16. #if ISFLOAT
  17. result.r = SrgbLinearToGamma( result.r ); //
  18. result.g = SrgbLinearToGamma( result.g ); // Linear to sRGB
  19. result.b = SrgbLinearToGamma( result.b ); //
  20. #endif
  21. return result;
  22. }