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.

30 lines
1.2 KiB

  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 ExposureTextureSampler0 : register( s0 );
  9. sampler ExposureTextureSampler1 : register( s1 );
  10. sampler ExposureTextureSampler2 : register( s2 );
  11. struct PS_INPUT
  12. {
  13. float2 baseTexCoord : TEXCOORD0;
  14. };
  15. float4_color_return_type main( PS_INPUT i ) : COLOR
  16. {
  17. float3 color0 = 0.25*tex2D( ExposureTextureSampler0, i.baseTexCoord );
  18. float3 color1 = 2.0*tex2D( ExposureTextureSampler1, i.baseTexCoord );
  19. float3 color2 = 16.0*tex2D( ExposureTextureSampler2, i.baseTexCoord );
  20. // This is never fogged.
  21. // 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
  22. 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
  23. }