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
4.7 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 portal_ps20_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. public:
  60. // CONSTRUCTOR
  61. portal_ps20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  62. {
  63. #ifdef _DEBUG
  64. m_bHASALPHAMASK = false;
  65. #endif // _DEBUG
  66. m_nHASALPHAMASK = 0;
  67. #ifdef _DEBUG
  68. m_bHASSTATICTEXTURE = false;
  69. #endif // _DEBUG
  70. m_nHASSTATICTEXTURE = 0;
  71. }
  72. int GetIndex()
  73. {
  74. // Asserts to make sure that we aren't using any skipped combinations.
  75. // Asserts to make sure that we are setting all of the combination vars.
  76. #ifdef _DEBUG
  77. bool bAllStaticVarsDefined = m_bHASALPHAMASK && m_bHASSTATICTEXTURE;
  78. Assert( bAllStaticVarsDefined );
  79. #endif // _DEBUG
  80. return ( 4 * m_nHASALPHAMASK ) + ( 8 * m_nHASSTATICTEXTURE ) + 0;
  81. }
  82. };
  83. #define shaderStaticTest_portal_ps20 psh_forgot_to_set_static_HASALPHAMASK + psh_forgot_to_set_static_HASSTATICTEXTURE + 0
  84. class portal_ps20_Dynamic_Index
  85. {
  86. private:
  87. int m_nADDSTATIC;
  88. #ifdef _DEBUG
  89. bool m_bADDSTATIC;
  90. #endif
  91. public:
  92. void SetADDSTATIC( int i )
  93. {
  94. Assert( i >= 0 && i <= 1 );
  95. m_nADDSTATIC = i;
  96. #ifdef _DEBUG
  97. m_bADDSTATIC = true;
  98. #endif
  99. }
  100. void SetADDSTATIC( bool i )
  101. {
  102. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  103. m_nADDSTATIC = i ? 1 : 0;
  104. #ifdef _DEBUG
  105. m_bADDSTATIC = true;
  106. #endif
  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_ps20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  133. {
  134. #ifdef _DEBUG
  135. m_bADDSTATIC = false;
  136. #endif // _DEBUG
  137. m_nADDSTATIC = 0;
  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_bADDSTATIC && m_bPIXELFOGTYPE;
  149. Assert( bAllDynamicVarsDefined );
  150. #endif // _DEBUG
  151. return ( 1 * m_nADDSTATIC ) + ( 2 * m_nPIXELFOGTYPE ) + 0;
  152. }
  153. };
  154. #define shaderDynamicTest_portal_ps20 psh_forgot_to_set_dynamic_ADDSTATIC + 0
  155. static const ShaderComboInformation_t s_DynamicComboArray_portal_ps20[2] =
  156. {
  157. { "ADDSTATIC", 0, 1 },
  158. { "PIXELFOGTYPE", 0, 1 },
  159. };
  160. static const ShaderComboInformation_t s_StaticComboArray_portal_ps20[2] =
  161. {
  162. { "HASALPHAMASK", 0, 1 },
  163. { "HASSTATICTEXTURE", 0, 1 },
  164. };
  165. static const ShaderComboSemantics_t portal_ps20_combos =
  166. {
  167. "portal_ps20", s_DynamicComboArray_portal_ps20, 2, s_StaticComboArray_portal_ps20, 2
  168. };
  169. class ConstructMe_portal_ps20
  170. {
  171. public:
  172. ConstructMe_portal_ps20()
  173. {
  174. GetShaderDLL()->AddShaderComboInformation( &portal_ps20_combos );
  175. }
  176. };
  177. static ConstructMe_portal_ps20 s_ConstructMe_portal_ps20;