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.

177 lines
4.2 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( $STAGE != 2 ) && ( $TINTED == 1 )
  3. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  4. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  5. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  6. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  7. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  8. #include "shaderlib/cshader.h"
  9. class portal_refract_ps20_Static_Index
  10. {
  11. private:
  12. int m_nSTAGE;
  13. #ifdef _DEBUG
  14. bool m_bSTAGE;
  15. #endif
  16. public:
  17. void SetSTAGE( int i )
  18. {
  19. Assert( i >= 0 && i <= 2 );
  20. m_nSTAGE = i;
  21. #ifdef _DEBUG
  22. m_bSTAGE = true;
  23. #endif
  24. }
  25. void SetSTAGE( bool i )
  26. {
  27. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 2 );
  28. m_nSTAGE = i ? 1 : 0;
  29. #ifdef _DEBUG
  30. m_bSTAGE = true;
  31. #endif
  32. }
  33. private:
  34. int m_nTINTED;
  35. #ifdef _DEBUG
  36. bool m_bTINTED;
  37. #endif
  38. public:
  39. void SetTINTED( int i )
  40. {
  41. Assert( i >= 0 && i <= 1 );
  42. m_nTINTED = i;
  43. #ifdef _DEBUG
  44. m_bTINTED = true;
  45. #endif
  46. }
  47. void SetTINTED( bool i )
  48. {
  49. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  50. m_nTINTED = i ? 1 : 0;
  51. #ifdef _DEBUG
  52. m_bTINTED = true;
  53. #endif
  54. }
  55. private:
  56. int m_nDOPIXELFOG;
  57. #ifdef _DEBUG
  58. bool m_bDOPIXELFOG;
  59. #endif
  60. public:
  61. void SetDOPIXELFOG( int i )
  62. {
  63. Assert( i >= 0 && i <= 0 );
  64. m_nDOPIXELFOG = i;
  65. #ifdef _DEBUG
  66. m_bDOPIXELFOG = true;
  67. #endif
  68. }
  69. void SetDOPIXELFOG( bool i )
  70. {
  71. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  72. m_nDOPIXELFOG = i ? 1 : 0;
  73. #ifdef _DEBUG
  74. m_bDOPIXELFOG = true;
  75. #endif
  76. }
  77. public:
  78. // CONSTRUCTOR
  79. portal_refract_ps20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  80. {
  81. #ifdef _DEBUG
  82. m_bSTAGE = false;
  83. #endif // _DEBUG
  84. m_nSTAGE = 0;
  85. #ifdef _DEBUG
  86. m_bTINTED = false;
  87. #endif // _DEBUG
  88. m_nTINTED = 0;
  89. #ifdef _DEBUG
  90. m_bDOPIXELFOG = true;
  91. #endif // _DEBUG
  92. m_nDOPIXELFOG = 0 ;
  93. }
  94. int GetIndex()
  95. {
  96. // Asserts to make sure that we aren't using any skipped combinations.
  97. // Asserts to make sure that we are setting all of the combination vars.
  98. #ifdef _DEBUG
  99. bool bAllStaticVarsDefined = m_bSTAGE && m_bTINTED && m_bDOPIXELFOG;
  100. Assert( bAllStaticVarsDefined );
  101. #endif // _DEBUG
  102. return ( 2 * m_nSTAGE ) + ( 6 * m_nTINTED ) + ( 12 * m_nDOPIXELFOG ) + 0;
  103. }
  104. };
  105. #define shaderStaticTest_portal_refract_ps20 psh_forgot_to_set_static_STAGE + psh_forgot_to_set_static_TINTED + 0
  106. class portal_refract_ps20_Dynamic_Index
  107. {
  108. private:
  109. int m_nPIXELFOGTYPE;
  110. #ifdef _DEBUG
  111. bool m_bPIXELFOGTYPE;
  112. #endif
  113. public:
  114. void SetPIXELFOGTYPE( int i )
  115. {
  116. Assert( i >= 0 && i <= 1 );
  117. m_nPIXELFOGTYPE = i;
  118. #ifdef _DEBUG
  119. m_bPIXELFOGTYPE = true;
  120. #endif
  121. }
  122. void SetPIXELFOGTYPE( bool i )
  123. {
  124. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  125. m_nPIXELFOGTYPE = i ? 1 : 0;
  126. #ifdef _DEBUG
  127. m_bPIXELFOGTYPE = true;
  128. #endif
  129. }
  130. public:
  131. // CONSTRUCTOR
  132. portal_refract_ps20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  133. {
  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_bPIXELFOGTYPE;
  145. Assert( bAllDynamicVarsDefined );
  146. #endif // _DEBUG
  147. return ( 1 * m_nPIXELFOGTYPE ) + 0;
  148. }
  149. };
  150. #define shaderDynamicTest_portal_refract_ps20 0
  151. static const ShaderComboInformation_t s_DynamicComboArray_portal_refract_ps20[1] =
  152. {
  153. { "PIXELFOGTYPE", 0, 1 },
  154. };
  155. static const ShaderComboInformation_t s_StaticComboArray_portal_refract_ps20[3] =
  156. {
  157. { "STAGE", 0, 2 },
  158. { "TINTED", 0, 1 },
  159. { "DOPIXELFOG", 0, 0 },
  160. };
  161. static const ShaderComboSemantics_t portal_refract_ps20_combos =
  162. {
  163. "portal_refract_ps20", s_DynamicComboArray_portal_refract_ps20, 1, s_StaticComboArray_portal_refract_ps20, 3
  164. };
  165. class ConstructMe_portal_refract_ps20
  166. {
  167. public:
  168. ConstructMe_portal_refract_ps20()
  169. {
  170. GetShaderDLL()->AddShaderComboInformation( &portal_refract_ps20_combos );
  171. }
  172. };
  173. static ConstructMe_portal_refract_ps20 s_ConstructMe_portal_refract_ps20;