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.

26 lines
739 B

  1. #define HDRTYPE HDR_TYPE_NONE
  2. #include "common_ps_fxc.h"
  3. sampler BaseTextureSampler : register( s0 );
  4. sampler CloudAlphaSampler : register( s1 );
  5. struct PS_INPUT
  6. {
  7. float2 baseCoords : TEXCOORD0;
  8. float2 cloudAlphaCoords : TEXCOORD1;
  9. float fogFactor : TEXCOORD2;
  10. };
  11. float4 main( PS_INPUT i ) : COLOR
  12. {
  13. float4 vBase = tex2D( BaseTextureSampler, i.baseCoords );
  14. float4 vCloudAlpha = tex2D( CloudAlphaSampler, i.cloudAlphaCoords );
  15. float fogFactor = 2.0f * smoothstep( 0.3f, 0.6f, i.fogFactor );
  16. float4 result = vBase * vCloudAlpha;
  17. result.a *= fogFactor;
  18. // No actual fog. Use the "fog factor" to modulate alpha (after some smoothstep mojo)
  19. return FinalOutput( result, 1.0f, PIXEL_FOG_TYPE_NONE, TONEMAP_SCALE_LINEAR );
  20. }