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.

120 lines
2.8 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  3. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  4. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  5. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  6. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  7. #include "shaderlib/cshader.h"
  8. class ui_ps20b_Static_Index
  9. {
  10. private:
  11. int m_nGRAYSCALE;
  12. #ifdef _DEBUG
  13. bool m_bGRAYSCALE;
  14. #endif
  15. public:
  16. void SetGRAYSCALE( int i )
  17. {
  18. Assert( i >= 0 && i <= 1 );
  19. m_nGRAYSCALE = i;
  20. #ifdef _DEBUG
  21. m_bGRAYSCALE = true;
  22. #endif
  23. }
  24. void SetGRAYSCALE( bool i )
  25. {
  26. m_nGRAYSCALE = i ? 1 : 0;
  27. #ifdef _DEBUG
  28. m_bGRAYSCALE = true;
  29. #endif
  30. }
  31. private:
  32. int m_nCOLORWARP;
  33. #ifdef _DEBUG
  34. bool m_bCOLORWARP;
  35. #endif
  36. public:
  37. void SetCOLORWARP( int i )
  38. {
  39. Assert( i >= 0 && i <= 1 );
  40. m_nCOLORWARP = i;
  41. #ifdef _DEBUG
  42. m_bCOLORWARP = true;
  43. #endif
  44. }
  45. void SetCOLORWARP( bool i )
  46. {
  47. m_nCOLORWARP = i ? 1 : 0;
  48. #ifdef _DEBUG
  49. m_bCOLORWARP = true;
  50. #endif
  51. }
  52. public:
  53. // CONSTRUCTOR
  54. ui_ps20b_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  55. {
  56. #ifdef _DEBUG
  57. m_bGRAYSCALE = false;
  58. #endif // _DEBUG
  59. m_nGRAYSCALE = 0;
  60. #ifdef _DEBUG
  61. m_bCOLORWARP = false;
  62. #endif // _DEBUG
  63. m_nCOLORWARP = 0;
  64. }
  65. int GetIndex()
  66. {
  67. // Asserts to make sure that we aren't using any skipped combinations.
  68. // Asserts to make sure that we are setting all of the combination vars.
  69. #ifdef _DEBUG
  70. bool bAllStaticVarsDefined = m_bGRAYSCALE && m_bCOLORWARP;
  71. Assert( bAllStaticVarsDefined );
  72. #endif // _DEBUG
  73. return ( 2 * m_nGRAYSCALE ) + ( 4 * m_nCOLORWARP ) + 0;
  74. }
  75. };
  76. #define shaderStaticTest_ui_ps20b psh_forgot_to_set_static_GRAYSCALE + psh_forgot_to_set_static_COLORWARP + 0
  77. class ui_ps20b_Dynamic_Index
  78. {
  79. private:
  80. int m_nPIXELFOGTYPE;
  81. #ifdef _DEBUG
  82. bool m_bPIXELFOGTYPE;
  83. #endif
  84. public:
  85. void SetPIXELFOGTYPE( int i )
  86. {
  87. Assert( i >= 0 && i <= 1 );
  88. m_nPIXELFOGTYPE = i;
  89. #ifdef _DEBUG
  90. m_bPIXELFOGTYPE = true;
  91. #endif
  92. }
  93. void SetPIXELFOGTYPE( bool i )
  94. {
  95. m_nPIXELFOGTYPE = i ? 1 : 0;
  96. #ifdef _DEBUG
  97. m_bPIXELFOGTYPE = true;
  98. #endif
  99. }
  100. public:
  101. // CONSTRUCTOR
  102. ui_ps20b_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  103. {
  104. #ifdef _DEBUG
  105. m_bPIXELFOGTYPE = true;
  106. #endif // _DEBUG
  107. m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  108. }
  109. int GetIndex()
  110. {
  111. // Asserts to make sure that we aren't using any skipped combinations.
  112. // Asserts to make sure that we are setting all of the combination vars.
  113. #ifdef _DEBUG
  114. bool bAllDynamicVarsDefined = m_bPIXELFOGTYPE;
  115. Assert( bAllDynamicVarsDefined );
  116. #endif // _DEBUG
  117. return ( 1 * m_nPIXELFOGTYPE ) + 0;
  118. }
  119. };
  120. #define shaderDynamicTest_ui_ps20b 0