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.

37 lines
1017 B

  1. //========== Copyright (c) Valve Corporation, All rights reserved. ==========//
  2. // STATIC: "FLASHLIGHTDEPTHFILTERMODE" "0..3" [ps20b] [PC]
  3. // STATIC: "FLASHLIGHTDEPTHFILTERMODE" "0..2" [ps30] [PC]
  4. // STATIC: "FLASHLIGHTDEPTHFILTERMODE" "0..0" [ps20b] [CONSOLE]
  5. // STATIC: "DEPTH_IN_ALPHA" "0..1"
  6. #include "common_ps_fxc.h"
  7. const float4 g_Parameters : register( c0 );
  8. sampler DepthTextureSampler : register( s0 ); // Scalar shadow depth map
  9. float4_color_return_type main( float2 baseTexCoord : TEXCOORD0 ) : COLOR
  10. {
  11. float fDepth = 0;
  12. # if (DEPTH_IN_ALPHA == 1)
  13. {
  14. fDepth = tex2D( DepthTextureSampler, baseTexCoord ).a;
  15. }
  16. # else
  17. {
  18. # if !(defined(SHADER_MODEL_PS_1_1) || defined(SHADER_MODEL_PS_1_4) || defined(SHADER_MODEL_PS_2_0)) //Minimum requirement of ps2b
  19. {
  20. fDepth = tex2D( DepthTextureSampler, baseTexCoord ).r;
  21. }
  22. # endif
  23. }
  24. # endif
  25. fDepth = pow( fDepth, g_Parameters.x );
  26. return FinalOutput( float4( fDepth, fDepth, fDepth, 1.0f ), 0, PIXEL_FOG_TYPE_NONE, TONEMAP_SCALE_NONE );
  27. }