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.

27 lines
812 B

  1. //========== Copyright (c) Valve Corporation, All rights reserved. ==========//
  2. // DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..1" [ps20b] [PC]
  3. // DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..0" [ps20b] [CONSOLE]
  4. #include "common_ps_fxc.h"
  5. #if defined( SHADER_MODEL_PS_2_0 )
  6. # define WRITE_DEPTH_TO_DESTALPHA 0
  7. #endif
  8. sampler BaseTextureSampler : register( s0 );
  9. float4 InputScale : register( c0 );
  10. struct PS_INPUT
  11. {
  12. float2 baseTexCoord : TEXCOORD0;
  13. };
  14. float4_color_return_type main( PS_INPUT i ) : COLOR
  15. {
  16. float4 color = tex2D( BaseTextureSampler, i.baseTexCoord.xy );
  17. color.rgb *= InputScale.rgb;
  18. // This is never fogged.
  19. 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
  20. }