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.

79 lines
1.9 KiB

  1. //========= Copyright � 1996-2004, Valve LLC, All rights reserved. ============
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #include "BaseVSShader.h"
  8. #include "common_hlsl_cpp_consts.h"
  9. #include "HDRSelectRange_ps20.inc"
  10. #include "HDRSelectRange_ps20b.inc"
  11. // NOTE: This has to be the last file included!
  12. #include "tier0/memdbgon.h"
  13. BEGIN_VS_SHADER_FLAGS( HDRSelectRange, "Help for HDRSelectRange", SHADER_NOT_EDITABLE )
  14. BEGIN_SHADER_PARAMS
  15. SHADER_PARAM( SOURCEMRTRENDERTARGET, SHADER_PARAM_TYPE_TEXTURE, "", "" )
  16. END_SHADER_PARAMS
  17. SHADER_INIT
  18. {
  19. LoadTexture( SOURCEMRTRENDERTARGET );
  20. }
  21. SHADER_FALLBACK
  22. {
  23. return 0;
  24. }
  25. SHADER_DRAW
  26. {
  27. SHADOW_STATE
  28. {
  29. pShaderShadow->EnableDepthWrites( false );
  30. pShaderShadow->EnableAlphaWrites( false );
  31. pShaderShadow->EnableDepthTest( false );
  32. pShaderShadow->EnableTexture( SHADER_SAMPLER0, true );
  33. pShaderShadow->EnableTexture( SHADER_SAMPLER1, true );
  34. int fmt = VERTEX_POSITION;
  35. pShaderShadow->VertexShaderVertexFormat( fmt, 1, 0, 0 );
  36. pShaderShadow->SetVertexShader( "HDRSelectRange_vs20", 0 );
  37. if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
  38. {
  39. DECLARE_STATIC_PIXEL_SHADER( hdrselectrange_ps20b );
  40. SET_STATIC_PIXEL_SHADER( hdrselectrange_ps20b );
  41. }
  42. else
  43. {
  44. DECLARE_STATIC_PIXEL_SHADER( hdrselectrange_ps20 );
  45. SET_STATIC_PIXEL_SHADER( hdrselectrange_ps20 );
  46. }
  47. }
  48. DYNAMIC_STATE
  49. {
  50. BindTexture( SHADER_SAMPLER0, TEXTURE_BINDFLAGS_NONE, SOURCEMRTRENDERTARGET, -1 );
  51. pShaderAPI->SetVertexShaderIndex( 0 );
  52. if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
  53. {
  54. DECLARE_DYNAMIC_PIXEL_SHADER( hdrselectrange_ps20b );
  55. SET_DYNAMIC_PIXEL_SHADER( hdrselectrange_ps20b );
  56. }
  57. else
  58. {
  59. DECLARE_DYNAMIC_PIXEL_SHADER( hdrselectrange_ps20 );
  60. SET_DYNAMIC_PIXEL_SHADER( hdrselectrange_ps20 );
  61. }
  62. }
  63. Draw();
  64. }
  65. END_SHADER