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.

265 lines
6.6 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( $CONVERT_FROM_LINEAR == 0 ) && ( $CONVERT_TO_LINEAR == 1 )
  3. // ( $TOOL_MODE == 0 ) && ( $CONVERT_FROM_LINEAR == 1 )
  4. // ( $TOOL_MODE == 0 ) && ( $CONVERT_TO_LINEAR == 1 )
  5. // ( $CONVERT_FROM_LINEAR == 1 ) && ( $LINEAR_INPUT == 1 )
  6. // ( $CONVERT_TO_LINEAR == 1 ) && ( $LINEAR_OUTPUT == 1 )
  7. // ( $LOCAL_CONTRAST_ENABLE == 0 ) && ( $BLURRED_VIGNETTE_ENABLE == 1 )
  8. // ( $TOOL_MODE == 0 ) && $TV_GAMMA
  9. // ( $TOOL_MODE == 0 ) && $DESATURATEENABLE
  10. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  11. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  12. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  13. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  14. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  15. #include "shaderlib/cshader.h"
  16. class engine_post_ps20_Static_Index
  17. {
  18. private:
  19. int m_nTOOL_MODE;
  20. #ifdef _DEBUG
  21. bool m_bTOOL_MODE;
  22. #endif
  23. public:
  24. void SetTOOL_MODE( int i )
  25. {
  26. Assert( i >= 0 && i <= 1 );
  27. m_nTOOL_MODE = i;
  28. #ifdef _DEBUG
  29. m_bTOOL_MODE = true;
  30. #endif
  31. }
  32. void SetTOOL_MODE( bool i )
  33. {
  34. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  35. m_nTOOL_MODE = i ? 1 : 0;
  36. #ifdef _DEBUG
  37. m_bTOOL_MODE = true;
  38. #endif
  39. }
  40. private:
  41. int m_nDEPTH_BLUR_ENABLE;
  42. #ifdef _DEBUG
  43. bool m_bDEPTH_BLUR_ENABLE;
  44. #endif
  45. public:
  46. void SetDEPTH_BLUR_ENABLE( int i )
  47. {
  48. Assert( i >= 0 && i <= 1 );
  49. m_nDEPTH_BLUR_ENABLE = i;
  50. #ifdef _DEBUG
  51. m_bDEPTH_BLUR_ENABLE = true;
  52. #endif
  53. }
  54. void SetDEPTH_BLUR_ENABLE( bool i )
  55. {
  56. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  57. m_nDEPTH_BLUR_ENABLE = i ? 1 : 0;
  58. #ifdef _DEBUG
  59. m_bDEPTH_BLUR_ENABLE = true;
  60. #endif
  61. }
  62. public:
  63. // CONSTRUCTOR
  64. engine_post_ps20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  65. {
  66. #ifdef _DEBUG
  67. m_bTOOL_MODE = false;
  68. #endif // _DEBUG
  69. m_nTOOL_MODE = 0;
  70. #ifdef _DEBUG
  71. m_bDEPTH_BLUR_ENABLE = false;
  72. #endif // _DEBUG
  73. m_nDEPTH_BLUR_ENABLE = 0;
  74. }
  75. int GetIndex()
  76. {
  77. // Asserts to make sure that we aren't using any skipped combinations.
  78. // Asserts to make sure that we are setting all of the combination vars.
  79. #ifdef _DEBUG
  80. bool bAllStaticVarsDefined = m_bTOOL_MODE && m_bDEPTH_BLUR_ENABLE;
  81. Assert( bAllStaticVarsDefined );
  82. #endif // _DEBUG
  83. return ( 24 * m_nTOOL_MODE ) + ( 48 * m_nDEPTH_BLUR_ENABLE ) + 0;
  84. }
  85. };
  86. #define shaderStaticTest_engine_post_ps20 psh_forgot_to_set_static_TOOL_MODE + psh_forgot_to_set_static_DEPTH_BLUR_ENABLE + 0
  87. class engine_post_ps20_Dynamic_Index
  88. {
  89. private:
  90. int m_nAA_ENABLE;
  91. #ifdef _DEBUG
  92. bool m_bAA_ENABLE;
  93. #endif
  94. public:
  95. void SetAA_ENABLE( int i )
  96. {
  97. Assert( i >= 0 && i <= 0 );
  98. m_nAA_ENABLE = i;
  99. #ifdef _DEBUG
  100. m_bAA_ENABLE = true;
  101. #endif
  102. }
  103. void SetAA_ENABLE( bool i )
  104. {
  105. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  106. m_nAA_ENABLE = i ? 1 : 0;
  107. #ifdef _DEBUG
  108. m_bAA_ENABLE = true;
  109. #endif
  110. }
  111. private:
  112. int m_nCOL_CORRECT_NUM_LOOKUPS;
  113. #ifdef _DEBUG
  114. bool m_bCOL_CORRECT_NUM_LOOKUPS;
  115. #endif
  116. public:
  117. void SetCOL_CORRECT_NUM_LOOKUPS( int i )
  118. {
  119. Assert( i >= 0 && i <= 3 );
  120. m_nCOL_CORRECT_NUM_LOOKUPS = i;
  121. #ifdef _DEBUG
  122. m_bCOL_CORRECT_NUM_LOOKUPS = true;
  123. #endif
  124. }
  125. void SetCOL_CORRECT_NUM_LOOKUPS( bool i )
  126. {
  127. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 3 );
  128. m_nCOL_CORRECT_NUM_LOOKUPS = i ? 1 : 0;
  129. #ifdef _DEBUG
  130. m_bCOL_CORRECT_NUM_LOOKUPS = true;
  131. #endif
  132. }
  133. private:
  134. int m_nFADE_TO_BLACK;
  135. #ifdef _DEBUG
  136. bool m_bFADE_TO_BLACK;
  137. #endif
  138. public:
  139. void SetFADE_TO_BLACK( int i )
  140. {
  141. Assert( i >= 0 && i <= 1 );
  142. m_nFADE_TO_BLACK = i;
  143. #ifdef _DEBUG
  144. m_bFADE_TO_BLACK = true;
  145. #endif
  146. }
  147. void SetFADE_TO_BLACK( bool i )
  148. {
  149. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  150. m_nFADE_TO_BLACK = i ? 1 : 0;
  151. #ifdef _DEBUG
  152. m_bFADE_TO_BLACK = true;
  153. #endif
  154. }
  155. private:
  156. int m_nFADE_TYPE;
  157. #ifdef _DEBUG
  158. bool m_bFADE_TYPE;
  159. #endif
  160. public:
  161. void SetFADE_TYPE( int i )
  162. {
  163. Assert( i >= 0 && i <= 2 );
  164. m_nFADE_TYPE = i;
  165. #ifdef _DEBUG
  166. m_bFADE_TYPE = true;
  167. #endif
  168. }
  169. void SetFADE_TYPE( bool i )
  170. {
  171. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 2 );
  172. m_nFADE_TYPE = i ? 1 : 0;
  173. #ifdef _DEBUG
  174. m_bFADE_TYPE = true;
  175. #endif
  176. }
  177. private:
  178. int m_nVOMIT_ENABLE;
  179. #ifdef _DEBUG
  180. bool m_bVOMIT_ENABLE;
  181. #endif
  182. public:
  183. void SetVOMIT_ENABLE( int i )
  184. {
  185. Assert( i >= 0 && i <= 0 );
  186. m_nVOMIT_ENABLE = i;
  187. #ifdef _DEBUG
  188. m_bVOMIT_ENABLE = true;
  189. #endif
  190. }
  191. void SetVOMIT_ENABLE( bool i )
  192. {
  193. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  194. m_nVOMIT_ENABLE = i ? 1 : 0;
  195. #ifdef _DEBUG
  196. m_bVOMIT_ENABLE = true;
  197. #endif
  198. }
  199. public:
  200. // CONSTRUCTOR
  201. engine_post_ps20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  202. {
  203. #ifdef _DEBUG
  204. m_bAA_ENABLE = false;
  205. #endif // _DEBUG
  206. m_nAA_ENABLE = 0;
  207. #ifdef _DEBUG
  208. m_bCOL_CORRECT_NUM_LOOKUPS = false;
  209. #endif // _DEBUG
  210. m_nCOL_CORRECT_NUM_LOOKUPS = 0;
  211. #ifdef _DEBUG
  212. m_bFADE_TO_BLACK = false;
  213. #endif // _DEBUG
  214. m_nFADE_TO_BLACK = 0;
  215. #ifdef _DEBUG
  216. m_bFADE_TYPE = false;
  217. #endif // _DEBUG
  218. m_nFADE_TYPE = 0;
  219. #ifdef _DEBUG
  220. m_bVOMIT_ENABLE = false;
  221. #endif // _DEBUG
  222. m_nVOMIT_ENABLE = 0;
  223. }
  224. int GetIndex()
  225. {
  226. // Asserts to make sure that we aren't using any skipped combinations.
  227. // Asserts to make sure that we are setting all of the combination vars.
  228. #ifdef _DEBUG
  229. bool bAllDynamicVarsDefined = m_bAA_ENABLE && m_bCOL_CORRECT_NUM_LOOKUPS && m_bFADE_TO_BLACK && m_bFADE_TYPE && m_bVOMIT_ENABLE;
  230. Assert( bAllDynamicVarsDefined );
  231. #endif // _DEBUG
  232. return ( 1 * m_nAA_ENABLE ) + ( 1 * m_nCOL_CORRECT_NUM_LOOKUPS ) + ( 4 * m_nFADE_TO_BLACK ) + ( 8 * m_nFADE_TYPE ) + ( 24 * m_nVOMIT_ENABLE ) + 0;
  233. }
  234. };
  235. #define shaderDynamicTest_engine_post_ps20 psh_forgot_to_set_dynamic_AA_ENABLE + psh_forgot_to_set_dynamic_COL_CORRECT_NUM_LOOKUPS + psh_forgot_to_set_dynamic_FADE_TO_BLACK + psh_forgot_to_set_dynamic_FADE_TYPE + psh_forgot_to_set_dynamic_VOMIT_ENABLE + 0
  236. static const ShaderComboInformation_t s_DynamicComboArray_Engine_Post_ps20[5] =
  237. {
  238. { "AA_ENABLE", 0, 0 },
  239. { "COL_CORRECT_NUM_LOOKUPS", 0, 3 },
  240. { "FADE_TO_BLACK", 0, 1 },
  241. { "FADE_TYPE", 0, 2 },
  242. { "VOMIT_ENABLE", 0, 0 },
  243. };
  244. static const ShaderComboInformation_t s_StaticComboArray_Engine_Post_ps20[2] =
  245. {
  246. { "TOOL_MODE", 0, 1 },
  247. { "DEPTH_BLUR_ENABLE", 0, 1 },
  248. };
  249. static const ShaderComboSemantics_t Engine_Post_ps20_combos =
  250. {
  251. "Engine_Post_ps20", s_DynamicComboArray_Engine_Post_ps20, 5, s_StaticComboArray_Engine_Post_ps20, 2
  252. };
  253. class ConstructMe_Engine_Post_ps20
  254. {
  255. public:
  256. ConstructMe_Engine_Post_ps20()
  257. {
  258. GetShaderDLL()->AddShaderComboInformation( &Engine_Post_ps20_combos );
  259. }
  260. };
  261. static ConstructMe_Engine_Post_ps20 s_ConstructMe_Engine_Post_ps20;