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.

29 lines
1.3 KiB

  1. // STATIC: "CONVERT_TO_SRGB" "0..1" [ps20b][= g_pHardwareConfig->NeedsShaderSRGBConversion()] [PC]
  2. // STATIC: "CONVERT_TO_SRGB" "0..0" [= 0] [XBOX]
  3. // DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..1" [ps20b] [PC]
  4. // DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..0" [ps20b] [XBOX]
  5. #include "common_ps_fxc.h"
  6. #if defined( SHADER_MODEL_PS_2_0 )
  7. # define WRITE_DEPTH_TO_DESTALPHA 0
  8. #endif
  9. sampler ExposureTextureSampler0 : register( s0 );
  10. sampler ExposureTextureSampler1 : register( s1 );
  11. sampler ExposureTextureSampler2 : register( s2 );
  12. struct PS_INPUT
  13. {
  14. float2 baseTexCoord : TEXCOORD0;
  15. };
  16. float4 main( PS_INPUT i ) : COLOR
  17. {
  18. HALF3 color0 = 0.25*tex2D( ExposureTextureSampler0, i.baseTexCoord );
  19. HALF3 color1 = 2.0*tex2D( ExposureTextureSampler1, i.baseTexCoord );
  20. HALF3 color2 = 16.0*tex2D( ExposureTextureSampler2, i.baseTexCoord );
  21. // This is never fogged.
  22. // return FinalOutput( float4( max(max(color0,color1),color2), 1.0f ), 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
  23. return FinalOutput( float4(1,0,0,1 ), 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
  24. }