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.

209 lines
5.6 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTSHADOWS == 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. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  9. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  10. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  11. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  12. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  13. #include "shaderlib/cshader.h"
  14. class worldimposter_ps20b_Static_Index
  15. {
  16. private:
  17. int m_nFLASHLIGHTDEPTHFILTERMODE;
  18. #ifdef _DEBUG
  19. bool m_bFLASHLIGHTDEPTHFILTERMODE;
  20. #endif
  21. public:
  22. void SetFLASHLIGHTDEPTHFILTERMODE( int i )
  23. {
  24. Assert( i >= 0 && i <= 3 );
  25. m_nFLASHLIGHTDEPTHFILTERMODE = i;
  26. #ifdef _DEBUG
  27. m_bFLASHLIGHTDEPTHFILTERMODE = true;
  28. #endif
  29. }
  30. void SetFLASHLIGHTDEPTHFILTERMODE( bool i )
  31. {
  32. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 3 );
  33. m_nFLASHLIGHTDEPTHFILTERMODE = i ? 1 : 0;
  34. #ifdef _DEBUG
  35. m_bFLASHLIGHTDEPTHFILTERMODE = true;
  36. #endif
  37. }
  38. private:
  39. int m_nDOPIXELFOG;
  40. #ifdef _DEBUG
  41. bool m_bDOPIXELFOG;
  42. #endif
  43. public:
  44. void SetDOPIXELFOG( int i )
  45. {
  46. Assert( i >= 0 && i <= 0 );
  47. m_nDOPIXELFOG = i;
  48. #ifdef _DEBUG
  49. m_bDOPIXELFOG = true;
  50. #endif
  51. }
  52. void SetDOPIXELFOG( bool i )
  53. {
  54. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  55. m_nDOPIXELFOG = i ? 1 : 0;
  56. #ifdef _DEBUG
  57. m_bDOPIXELFOG = true;
  58. #endif
  59. }
  60. public:
  61. // CONSTRUCTOR
  62. worldimposter_ps20b_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  63. {
  64. #ifdef _DEBUG
  65. m_bFLASHLIGHTDEPTHFILTERMODE = false;
  66. #endif // _DEBUG
  67. m_nFLASHLIGHTDEPTHFILTERMODE = 0;
  68. #ifdef _DEBUG
  69. m_bDOPIXELFOG = true;
  70. #endif // _DEBUG
  71. m_nDOPIXELFOG = 0 ;
  72. }
  73. int GetIndex()
  74. {
  75. // Asserts to make sure that we aren't using any skipped combinations.
  76. // Asserts to make sure that we are setting all of the combination vars.
  77. #ifdef _DEBUG
  78. bool bAllStaticVarsDefined = m_bFLASHLIGHTDEPTHFILTERMODE && m_bDOPIXELFOG;
  79. Assert( bAllStaticVarsDefined );
  80. #endif // _DEBUG
  81. return ( 4 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 16 * m_nDOPIXELFOG ) + 0;
  82. }
  83. };
  84. #define shaderStaticTest_worldimposter_ps20b psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + 0
  85. class worldimposter_ps20b_Dynamic_Index
  86. {
  87. private:
  88. int m_nFLASHLIGHT;
  89. #ifdef _DEBUG
  90. bool m_bFLASHLIGHT;
  91. #endif
  92. public:
  93. void SetFLASHLIGHT( int i )
  94. {
  95. Assert( i >= 0 && i <= 1 );
  96. m_nFLASHLIGHT = i;
  97. #ifdef _DEBUG
  98. m_bFLASHLIGHT = true;
  99. #endif
  100. }
  101. void SetFLASHLIGHT( bool i )
  102. {
  103. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  104. m_nFLASHLIGHT = i ? 1 : 0;
  105. #ifdef _DEBUG
  106. m_bFLASHLIGHT = true;
  107. #endif
  108. }
  109. private:
  110. int m_nFLASHLIGHTSHADOWS;
  111. #ifdef _DEBUG
  112. bool m_bFLASHLIGHTSHADOWS;
  113. #endif
  114. public:
  115. void SetFLASHLIGHTSHADOWS( int i )
  116. {
  117. Assert( i >= 0 && i <= 1 );
  118. m_nFLASHLIGHTSHADOWS = i;
  119. #ifdef _DEBUG
  120. m_bFLASHLIGHTSHADOWS = true;
  121. #endif
  122. }
  123. void SetFLASHLIGHTSHADOWS( bool i )
  124. {
  125. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  126. m_nFLASHLIGHTSHADOWS = i ? 1 : 0;
  127. #ifdef _DEBUG
  128. m_bFLASHLIGHTSHADOWS = true;
  129. #endif
  130. }
  131. private:
  132. int m_nPIXELFOGTYPE;
  133. #ifdef _DEBUG
  134. bool m_bPIXELFOGTYPE;
  135. #endif
  136. public:
  137. void SetPIXELFOGTYPE( int i )
  138. {
  139. Assert( i >= 0 && i <= 0 );
  140. m_nPIXELFOGTYPE = i;
  141. #ifdef _DEBUG
  142. m_bPIXELFOGTYPE = true;
  143. #endif
  144. }
  145. void SetPIXELFOGTYPE( bool i )
  146. {
  147. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  148. m_nPIXELFOGTYPE = i ? 1 : 0;
  149. #ifdef _DEBUG
  150. m_bPIXELFOGTYPE = true;
  151. #endif
  152. }
  153. public:
  154. // CONSTRUCTOR
  155. worldimposter_ps20b_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  156. {
  157. #ifdef _DEBUG
  158. m_bFLASHLIGHT = false;
  159. #endif // _DEBUG
  160. m_nFLASHLIGHT = 0;
  161. #ifdef _DEBUG
  162. m_bFLASHLIGHTSHADOWS = false;
  163. #endif // _DEBUG
  164. m_nFLASHLIGHTSHADOWS = 0;
  165. #ifdef _DEBUG
  166. m_bPIXELFOGTYPE = true;
  167. #endif // _DEBUG
  168. m_nPIXELFOGTYPE = 0; ;
  169. }
  170. int GetIndex()
  171. {
  172. // Asserts to make sure that we aren't using any skipped combinations.
  173. // Asserts to make sure that we are setting all of the combination vars.
  174. #ifdef _DEBUG
  175. bool bAllDynamicVarsDefined = m_bFLASHLIGHT && m_bFLASHLIGHTSHADOWS && m_bPIXELFOGTYPE;
  176. Assert( bAllDynamicVarsDefined );
  177. #endif // _DEBUG
  178. return ( 1 * m_nFLASHLIGHT ) + ( 2 * m_nFLASHLIGHTSHADOWS ) + ( 4 * m_nPIXELFOGTYPE ) + 0;
  179. }
  180. };
  181. #define shaderDynamicTest_worldimposter_ps20b psh_forgot_to_set_dynamic_FLASHLIGHT + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + 0
  182. static const ShaderComboInformation_t s_DynamicComboArray_worldimposter_ps20b[3] =
  183. {
  184. { "FLASHLIGHT", 0, 1 },
  185. { "FLASHLIGHTSHADOWS", 0, 1 },
  186. { "PIXELFOGTYPE", 0, 0 },
  187. };
  188. static const ShaderComboInformation_t s_StaticComboArray_worldimposter_ps20b[2] =
  189. {
  190. { "FLASHLIGHTDEPTHFILTERMODE", 0, 3 },
  191. { "DOPIXELFOG", 0, 0 },
  192. };
  193. static const ShaderComboSemantics_t worldimposter_ps20b_combos =
  194. {
  195. "worldimposter_ps20b", s_DynamicComboArray_worldimposter_ps20b, 3, s_StaticComboArray_worldimposter_ps20b, 2
  196. };
  197. class ConstructMe_worldimposter_ps20b
  198. {
  199. public:
  200. ConstructMe_worldimposter_ps20b()
  201. {
  202. GetShaderDLL()->AddShaderComboInformation( &worldimposter_ps20b_combos );
  203. }
  204. };
  205. static ConstructMe_worldimposter_ps20b s_ConstructMe_worldimposter_ps20b;