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.

34 lines
888 B

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