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.

27 lines
899 B

  1. // HDRFIXME: Make this work with nonHDR
  2. // STATIC: "CONVERT_TO_SRGB" "0..1" [ps20b][= g_pHardwareConfig->NeedsShaderSRGBConversion()] [PC]
  3. // STATIC: "CONVERT_TO_SRGB" "0..0" [= 0] [XBOX]
  4. // DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..1" [ps20b] [PC]
  5. // DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..0" [ps20b] [XBOX]
  6. #include "common_ps_fxc.h"
  7. #if defined( SHADER_MODEL_PS_2_0 )
  8. # define WRITE_DEPTH_TO_DESTALPHA 0
  9. #endif
  10. sampler BaseTextureSampler : register( s0 );
  11. HALF4 InputScale : register( c0 );
  12. struct PS_INPUT
  13. {
  14. float2 baseTexCoord : TEXCOORD0;
  15. };
  16. float4 main( PS_INPUT i ) : COLOR
  17. {
  18. HALF4 color = tex2D( BaseTextureSampler, i.baseTexCoord.xy );
  19. color.rgb *= InputScale.rgb;
  20. // This is never fogged.
  21. return FinalOutput( color, 0, PIXEL_FOG_TYPE_NONE, TONEMAP_SCALE_LINEAR, WRITE_DEPTH_TO_DESTALPHA, 1e20 ); //when writing depth to dest alpha, write a value guaranteed to saturate
  22. }