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.

26 lines
878 B

  1. // DYNAMIC: "PIXELFOGTYPE" "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 "shader_constant_register_map.h"
  5. #include "common_ps_fxc.h"
  6. sampler BaseTextureSampler : register( s0 );
  7. const float4 g_FogParams : register( PSREG_FOG_PARAMS );
  8. const float4 g_EyePos_SpecExponent : register( PSREG_EYEPOS_SPEC_EXPONENT );
  9. struct PS_INPUT
  10. {
  11. float2 vTexCoord0 : TEXCOORD0;
  12. float4 worldPos_projPosZ : TEXCOORD4; // Necessary for pixel fog
  13. };
  14. float4 main( PS_INPUT i ) : COLOR
  15. {
  16. HALF4 result = tex2D( BaseTextureSampler, i.vTexCoord0 );
  17. float fogFactor = CalcPixelFogFactor( PIXELFOGTYPE, g_FogParams, g_EyePos_SpecExponent.z, i.worldPos_projPosZ.z, i.worldPos_projPosZ.w );
  18. return FinalOutput( result, fogFactor, PIXELFOGTYPE, TONEMAP_SCALE_LINEAR );
  19. }