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.

181 lines
5.1 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 portalstaticoverlay_ps20b_Static_Index
  14. {
  15. private:
  16. int m_nHASALPHAMASK;
  17. #ifdef _DEBUG
  18. bool m_bHASALPHAMASK;
  19. #endif
  20. public:
  21. void SetHASALPHAMASK( int i )
  22. {
  23. Assert( i >= 0 && i <= 1 );
  24. m_nHASALPHAMASK = i;
  25. #ifdef _DEBUG
  26. m_bHASALPHAMASK = true;
  27. #endif
  28. }
  29. void SetHASALPHAMASK( bool i )
  30. {
  31. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  32. m_nHASALPHAMASK = i ? 1 : 0;
  33. #ifdef _DEBUG
  34. m_bHASALPHAMASK = true;
  35. #endif
  36. }
  37. private:
  38. int m_nHASSTATICTEXTURE;
  39. #ifdef _DEBUG
  40. bool m_bHASSTATICTEXTURE;
  41. #endif
  42. public:
  43. void SetHASSTATICTEXTURE( int i )
  44. {
  45. Assert( i >= 0 && i <= 1 );
  46. m_nHASSTATICTEXTURE = i;
  47. #ifdef _DEBUG
  48. m_bHASSTATICTEXTURE = true;
  49. #endif
  50. }
  51. void SetHASSTATICTEXTURE( bool i )
  52. {
  53. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  54. m_nHASSTATICTEXTURE = i ? 1 : 0;
  55. #ifdef _DEBUG
  56. m_bHASSTATICTEXTURE = true;
  57. #endif
  58. }
  59. private:
  60. int m_nPORTALGHOSTOVERLAY;
  61. #ifdef _DEBUG
  62. bool m_bPORTALGHOSTOVERLAY;
  63. #endif
  64. public:
  65. void SetPORTALGHOSTOVERLAY( int i )
  66. {
  67. Assert( i >= 0 && i <= 1 );
  68. m_nPORTALGHOSTOVERLAY = i;
  69. #ifdef _DEBUG
  70. m_bPORTALGHOSTOVERLAY = true;
  71. #endif
  72. }
  73. void SetPORTALGHOSTOVERLAY( bool i )
  74. {
  75. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  76. m_nPORTALGHOSTOVERLAY = i ? 1 : 0;
  77. #ifdef _DEBUG
  78. m_bPORTALGHOSTOVERLAY = true;
  79. #endif
  80. }
  81. public:
  82. // CONSTRUCTOR
  83. portalstaticoverlay_ps20b_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  84. {
  85. #ifdef _DEBUG
  86. m_bHASALPHAMASK = false;
  87. #endif // _DEBUG
  88. m_nHASALPHAMASK = 0;
  89. #ifdef _DEBUG
  90. m_bHASSTATICTEXTURE = false;
  91. #endif // _DEBUG
  92. m_nHASSTATICTEXTURE = 0;
  93. #ifdef _DEBUG
  94. m_bPORTALGHOSTOVERLAY = false;
  95. #endif // _DEBUG
  96. m_nPORTALGHOSTOVERLAY = 0;
  97. }
  98. int GetIndex()
  99. {
  100. // Asserts to make sure that we aren't using any skipped combinations.
  101. // Asserts to make sure that we are setting all of the combination vars.
  102. #ifdef _DEBUG
  103. bool bAllStaticVarsDefined = m_bHASALPHAMASK && m_bHASSTATICTEXTURE && m_bPORTALGHOSTOVERLAY;
  104. Assert( bAllStaticVarsDefined );
  105. #endif // _DEBUG
  106. return ( 2 * m_nHASALPHAMASK ) + ( 4 * m_nHASSTATICTEXTURE ) + ( 8 * m_nPORTALGHOSTOVERLAY ) + 0;
  107. }
  108. };
  109. #define shaderStaticTest_portalstaticoverlay_ps20b psh_forgot_to_set_static_HASALPHAMASK + psh_forgot_to_set_static_HASSTATICTEXTURE + psh_forgot_to_set_static_PORTALGHOSTOVERLAY + 0
  110. class portalstaticoverlay_ps20b_Dynamic_Index
  111. {
  112. private:
  113. int m_nPIXELFOGTYPE;
  114. #ifdef _DEBUG
  115. bool m_bPIXELFOGTYPE;
  116. #endif
  117. public:
  118. void SetPIXELFOGTYPE( int i )
  119. {
  120. Assert( i >= 0 && i <= 1 );
  121. m_nPIXELFOGTYPE = i;
  122. #ifdef _DEBUG
  123. m_bPIXELFOGTYPE = true;
  124. #endif
  125. }
  126. void SetPIXELFOGTYPE( bool i )
  127. {
  128. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  129. m_nPIXELFOGTYPE = i ? 1 : 0;
  130. #ifdef _DEBUG
  131. m_bPIXELFOGTYPE = true;
  132. #endif
  133. }
  134. public:
  135. // CONSTRUCTOR
  136. portalstaticoverlay_ps20b_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  137. {
  138. #ifdef _DEBUG
  139. m_bPIXELFOGTYPE = true;
  140. #endif // _DEBUG
  141. m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  142. }
  143. int GetIndex()
  144. {
  145. // Asserts to make sure that we aren't using any skipped combinations.
  146. // Asserts to make sure that we are setting all of the combination vars.
  147. #ifdef _DEBUG
  148. bool bAllDynamicVarsDefined = m_bPIXELFOGTYPE;
  149. Assert( bAllDynamicVarsDefined );
  150. #endif // _DEBUG
  151. return ( 1 * m_nPIXELFOGTYPE ) + 0;
  152. }
  153. };
  154. #define shaderDynamicTest_portalstaticoverlay_ps20b 0
  155. static const ShaderComboInformation_t s_DynamicComboArray_portalstaticoverlay_ps20b[1] =
  156. {
  157. { "PIXELFOGTYPE", 0, 1 },
  158. };
  159. static const ShaderComboInformation_t s_StaticComboArray_portalstaticoverlay_ps20b[3] =
  160. {
  161. { "HASALPHAMASK", 0, 1 },
  162. { "HASSTATICTEXTURE", 0, 1 },
  163. { "PORTALGHOSTOVERLAY", 0, 1 },
  164. };
  165. static const ShaderComboSemantics_t portalstaticoverlay_ps20b_combos =
  166. {
  167. "portalstaticoverlay_ps20b", s_DynamicComboArray_portalstaticoverlay_ps20b, 1, s_StaticComboArray_portalstaticoverlay_ps20b, 3
  168. };
  169. class ConstructMe_portalstaticoverlay_ps20b
  170. {
  171. public:
  172. ConstructMe_portalstaticoverlay_ps20b()
  173. {
  174. GetShaderDLL()->AddShaderComboInformation( &portalstaticoverlay_ps20b_combos );
  175. }
  176. };
  177. static ConstructMe_portalstaticoverlay_ps20b s_ConstructMe_portalstaticoverlay_ps20b;