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.

35 lines
725 B

  1. //========== Copyright (c) Valve Corporation, All rights reserved. ==========//
  2. #include "common_ps_fxc.h"
  3. sampler FBSampler : register( s0 );
  4. struct PS_INPUT
  5. {
  6. float2 texCoord : TEXCOORD0;
  7. };
  8. #define MAX_LUM 5
  9. #define MIN_LUM .1
  10. float4_color_return_type main( PS_INPUT i ) : COLOR
  11. {
  12. float4 fbSample = tex2D( FBSampler, i.texCoord );
  13. float lum=0.33*(fbSample.x+fbSample.y+fbSample.z);
  14. // derive a luminance-based scale factor for tone mapping
  15. float factor=1.0;
  16. if (lum<MIN_LUM)
  17. {
  18. }
  19. else if (lum>MAX_LUM)
  20. {
  21. }
  22. // linear scale for tone mapping
  23. // fbSample *= lum * LINEAR_LIGHT_SCALE;
  24. // assume that sRGB write is enabled.
  25. return FinalOutput( fbSample, 0, PIXEL_FOG_TYPE_NONE, TONEMAP_SCALE_NONE );
  26. }