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.

230 lines
5.4 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 shatteredglass_ps20_Static_Index
  9. {
  10. private:
  11. int m_nCUBEMAP;
  12. #ifdef _DEBUG
  13. bool m_bCUBEMAP;
  14. #endif
  15. public:
  16. void SetCUBEMAP( int i )
  17. {
  18. Assert( i >= 0 && i <= 1 );
  19. m_nCUBEMAP = i;
  20. #ifdef _DEBUG
  21. m_bCUBEMAP = true;
  22. #endif
  23. }
  24. void SetCUBEMAP( bool i )
  25. {
  26. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  27. m_nCUBEMAP = i ? 1 : 0;
  28. #ifdef _DEBUG
  29. m_bCUBEMAP = true;
  30. #endif
  31. }
  32. private:
  33. int m_nVERTEXCOLOR;
  34. #ifdef _DEBUG
  35. bool m_bVERTEXCOLOR;
  36. #endif
  37. public:
  38. void SetVERTEXCOLOR( int i )
  39. {
  40. Assert( i >= 0 && i <= 1 );
  41. m_nVERTEXCOLOR = i;
  42. #ifdef _DEBUG
  43. m_bVERTEXCOLOR = true;
  44. #endif
  45. }
  46. void SetVERTEXCOLOR( bool i )
  47. {
  48. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  49. m_nVERTEXCOLOR = i ? 1 : 0;
  50. #ifdef _DEBUG
  51. m_bVERTEXCOLOR = true;
  52. #endif
  53. }
  54. private:
  55. int m_nENVMAPMASK;
  56. #ifdef _DEBUG
  57. bool m_bENVMAPMASK;
  58. #endif
  59. public:
  60. void SetENVMAPMASK( int i )
  61. {
  62. Assert( i >= 0 && i <= 1 );
  63. m_nENVMAPMASK = i;
  64. #ifdef _DEBUG
  65. m_bENVMAPMASK = true;
  66. #endif
  67. }
  68. void SetENVMAPMASK( bool i )
  69. {
  70. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  71. m_nENVMAPMASK = i ? 1 : 0;
  72. #ifdef _DEBUG
  73. m_bENVMAPMASK = true;
  74. #endif
  75. }
  76. private:
  77. int m_nBASEALPHAENVMAPMASK;
  78. #ifdef _DEBUG
  79. bool m_bBASEALPHAENVMAPMASK;
  80. #endif
  81. public:
  82. void SetBASEALPHAENVMAPMASK( int i )
  83. {
  84. Assert( i >= 0 && i <= 1 );
  85. m_nBASEALPHAENVMAPMASK = i;
  86. #ifdef _DEBUG
  87. m_bBASEALPHAENVMAPMASK = true;
  88. #endif
  89. }
  90. void SetBASEALPHAENVMAPMASK( bool i )
  91. {
  92. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  93. m_nBASEALPHAENVMAPMASK = i ? 1 : 0;
  94. #ifdef _DEBUG
  95. m_bBASEALPHAENVMAPMASK = true;
  96. #endif
  97. }
  98. private:
  99. int m_nHDRTYPE;
  100. #ifdef _DEBUG
  101. bool m_bHDRTYPE;
  102. #endif
  103. public:
  104. void SetHDRTYPE( int i )
  105. {
  106. Assert( i >= 0 && i <= 2 );
  107. m_nHDRTYPE = i;
  108. #ifdef _DEBUG
  109. m_bHDRTYPE = true;
  110. #endif
  111. }
  112. void SetHDRTYPE( bool i )
  113. {
  114. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 2 );
  115. m_nHDRTYPE = i ? 1 : 0;
  116. #ifdef _DEBUG
  117. m_bHDRTYPE = true;
  118. #endif
  119. }
  120. public:
  121. // CONSTRUCTOR
  122. shatteredglass_ps20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  123. {
  124. #ifdef _DEBUG
  125. m_bCUBEMAP = false;
  126. #endif // _DEBUG
  127. m_nCUBEMAP = 0;
  128. #ifdef _DEBUG
  129. m_bVERTEXCOLOR = false;
  130. #endif // _DEBUG
  131. m_nVERTEXCOLOR = 0;
  132. #ifdef _DEBUG
  133. m_bENVMAPMASK = false;
  134. #endif // _DEBUG
  135. m_nENVMAPMASK = 0;
  136. #ifdef _DEBUG
  137. m_bBASEALPHAENVMAPMASK = false;
  138. #endif // _DEBUG
  139. m_nBASEALPHAENVMAPMASK = 0;
  140. #ifdef _DEBUG
  141. m_bHDRTYPE = false;
  142. #endif // _DEBUG
  143. m_nHDRTYPE = 0;
  144. }
  145. int GetIndex()
  146. {
  147. // Asserts to make sure that we aren't using any skipped combinations.
  148. // Asserts to make sure that we are setting all of the combination vars.
  149. #ifdef _DEBUG
  150. bool bAllStaticVarsDefined = m_bCUBEMAP && m_bVERTEXCOLOR && m_bENVMAPMASK && m_bBASEALPHAENVMAPMASK && m_bHDRTYPE;
  151. Assert( bAllStaticVarsDefined );
  152. #endif // _DEBUG
  153. return ( 2 * m_nCUBEMAP ) + ( 4 * m_nVERTEXCOLOR ) + ( 8 * m_nENVMAPMASK ) + ( 16 * m_nBASEALPHAENVMAPMASK ) + ( 32 * m_nHDRTYPE ) + 0;
  154. }
  155. };
  156. #define shaderStaticTest_shatteredglass_ps20 psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_VERTEXCOLOR + psh_forgot_to_set_static_ENVMAPMASK + psh_forgot_to_set_static_BASEALPHAENVMAPMASK + psh_forgot_to_set_static_HDRTYPE + 0
  157. class shatteredglass_ps20_Dynamic_Index
  158. {
  159. private:
  160. int m_nPIXELFOGTYPE;
  161. #ifdef _DEBUG
  162. bool m_bPIXELFOGTYPE;
  163. #endif
  164. public:
  165. void SetPIXELFOGTYPE( int i )
  166. {
  167. Assert( i >= 0 && i <= 1 );
  168. m_nPIXELFOGTYPE = i;
  169. #ifdef _DEBUG
  170. m_bPIXELFOGTYPE = true;
  171. #endif
  172. }
  173. void SetPIXELFOGTYPE( bool i )
  174. {
  175. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  176. m_nPIXELFOGTYPE = i ? 1 : 0;
  177. #ifdef _DEBUG
  178. m_bPIXELFOGTYPE = true;
  179. #endif
  180. }
  181. public:
  182. // CONSTRUCTOR
  183. shatteredglass_ps20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  184. {
  185. #ifdef _DEBUG
  186. m_bPIXELFOGTYPE = true;
  187. #endif // _DEBUG
  188. m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  189. }
  190. int GetIndex()
  191. {
  192. // Asserts to make sure that we aren't using any skipped combinations.
  193. // Asserts to make sure that we are setting all of the combination vars.
  194. #ifdef _DEBUG
  195. bool bAllDynamicVarsDefined = m_bPIXELFOGTYPE;
  196. Assert( bAllDynamicVarsDefined );
  197. #endif // _DEBUG
  198. return ( 1 * m_nPIXELFOGTYPE ) + 0;
  199. }
  200. };
  201. #define shaderDynamicTest_shatteredglass_ps20 0
  202. static const ShaderComboInformation_t s_DynamicComboArray_ShatteredGlass_ps20[1] =
  203. {
  204. { "PIXELFOGTYPE", 0, 1 },
  205. };
  206. static const ShaderComboInformation_t s_StaticComboArray_ShatteredGlass_ps20[5] =
  207. {
  208. { "CUBEMAP", 0, 1 },
  209. { "VERTEXCOLOR", 0, 1 },
  210. { "ENVMAPMASK", 0, 1 },
  211. { "BASEALPHAENVMAPMASK", 0, 1 },
  212. { "HDRTYPE", 0, 2 },
  213. };
  214. static const ShaderComboSemantics_t ShatteredGlass_ps20_combos =
  215. {
  216. "ShatteredGlass_ps20", s_DynamicComboArray_ShatteredGlass_ps20, 1, s_StaticComboArray_ShatteredGlass_ps20, 5
  217. };
  218. class ConstructMe_ShatteredGlass_ps20
  219. {
  220. public:
  221. ConstructMe_ShatteredGlass_ps20()
  222. {
  223. GetShaderDLL()->AddShaderComboInformation( &ShatteredGlass_ps20_combos );
  224. }
  225. };
  226. static ConstructMe_ShatteredGlass_ps20 s_ConstructMe_ShatteredGlass_ps20;