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.

150 lines
3.6 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. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  8. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  9. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  10. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  11. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  12. #include "shaderlib/cshader.h"
  13. class ssao_ps20_Static_Index
  14. {
  15. private:
  16. int m_nFINAL;
  17. #ifdef _DEBUG
  18. bool m_bFINAL;
  19. #endif
  20. public:
  21. void SetFINAL( int i )
  22. {
  23. Assert( i >= 0 && i <= 1 );
  24. m_nFINAL = i;
  25. #ifdef _DEBUG
  26. m_bFINAL = true;
  27. #endif
  28. }
  29. void SetFINAL( bool i )
  30. {
  31. m_nFINAL = i ? 1 : 0;
  32. #ifdef _DEBUG
  33. m_bFINAL = true;
  34. #endif
  35. }
  36. private:
  37. int m_nFOW;
  38. #ifdef _DEBUG
  39. bool m_bFOW;
  40. #endif
  41. public:
  42. void SetFOW( int i )
  43. {
  44. Assert( i >= 0 && i <= 1 );
  45. m_nFOW = i;
  46. #ifdef _DEBUG
  47. m_bFOW = true;
  48. #endif
  49. }
  50. void SetFOW( bool i )
  51. {
  52. m_nFOW = i ? 1 : 0;
  53. #ifdef _DEBUG
  54. m_bFOW = true;
  55. #endif
  56. }
  57. public:
  58. // CONSTRUCTOR
  59. ssao_ps20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  60. {
  61. #ifdef _DEBUG
  62. m_bFINAL = false;
  63. #endif // _DEBUG
  64. m_nFINAL = 0;
  65. #ifdef _DEBUG
  66. m_bFOW = false;
  67. #endif // _DEBUG
  68. m_nFOW = 0;
  69. }
  70. int GetIndex()
  71. {
  72. // Asserts to make sure that we aren't using any skipped combinations.
  73. // Asserts to make sure that we are setting all of the combination vars.
  74. #ifdef _DEBUG
  75. bool bAllStaticVarsDefined = m_bFINAL && m_bFOW;
  76. Assert( bAllStaticVarsDefined );
  77. #endif // _DEBUG
  78. return ( 4 * m_nFINAL ) + ( 8 * m_nFOW ) + 0;
  79. }
  80. };
  81. #define shaderStaticTest_ssao_ps20 psh_forgot_to_set_static_FINAL + psh_forgot_to_set_static_FOW + 0
  82. class ssao_ps20_Dynamic_Index
  83. {
  84. private:
  85. int m_nDEFERRED;
  86. #ifdef _DEBUG
  87. bool m_bDEFERRED;
  88. #endif
  89. public:
  90. void SetDEFERRED( int i )
  91. {
  92. Assert( i >= 0 && i <= 1 );
  93. m_nDEFERRED = i;
  94. #ifdef _DEBUG
  95. m_bDEFERRED = true;
  96. #endif
  97. }
  98. void SetDEFERRED( bool i )
  99. {
  100. m_nDEFERRED = i ? 1 : 0;
  101. #ifdef _DEBUG
  102. m_bDEFERRED = true;
  103. #endif
  104. }
  105. private:
  106. int m_nPIXELFOGTYPE;
  107. #ifdef _DEBUG
  108. bool m_bPIXELFOGTYPE;
  109. #endif
  110. public:
  111. void SetPIXELFOGTYPE( int i )
  112. {
  113. Assert( i >= 0 && i <= 1 );
  114. m_nPIXELFOGTYPE = i;
  115. #ifdef _DEBUG
  116. m_bPIXELFOGTYPE = true;
  117. #endif
  118. }
  119. void SetPIXELFOGTYPE( bool i )
  120. {
  121. m_nPIXELFOGTYPE = i ? 1 : 0;
  122. #ifdef _DEBUG
  123. m_bPIXELFOGTYPE = true;
  124. #endif
  125. }
  126. public:
  127. // CONSTRUCTOR
  128. ssao_ps20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  129. {
  130. #ifdef _DEBUG
  131. m_bDEFERRED = false;
  132. #endif // _DEBUG
  133. m_nDEFERRED = 0;
  134. #ifdef _DEBUG
  135. m_bPIXELFOGTYPE = true;
  136. #endif // _DEBUG
  137. m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  138. }
  139. int GetIndex()
  140. {
  141. // Asserts to make sure that we aren't using any skipped combinations.
  142. // Asserts to make sure that we are setting all of the combination vars.
  143. #ifdef _DEBUG
  144. bool bAllDynamicVarsDefined = m_bDEFERRED && m_bPIXELFOGTYPE;
  145. Assert( bAllDynamicVarsDefined );
  146. #endif // _DEBUG
  147. return ( 1 * m_nDEFERRED ) + ( 2 * m_nPIXELFOGTYPE ) + 0;
  148. }
  149. };
  150. #define shaderDynamicTest_ssao_ps20 psh_forgot_to_set_dynamic_DEFERRED + 0