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.

227 lines
5.0 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( $DOWATERFOG == 0 ) && ( $DOPIXELFOG && $HARDWAREFOGBLEND )
  3. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  4. #include "shaderlib/cshader.h"
  5. class worldimposter_vs20_Static_Index
  6. {
  7. private:
  8. int m_nDOPIXELFOG;
  9. #ifdef _DEBUG
  10. bool m_bDOPIXELFOG;
  11. #endif
  12. public:
  13. void SetDOPIXELFOG( int i )
  14. {
  15. Assert( i >= 0 && i <= 0 );
  16. m_nDOPIXELFOG = i;
  17. #ifdef _DEBUG
  18. m_bDOPIXELFOG = true;
  19. #endif
  20. }
  21. void SetDOPIXELFOG( bool i )
  22. {
  23. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  24. m_nDOPIXELFOG = i ? 1 : 0;
  25. #ifdef _DEBUG
  26. m_bDOPIXELFOG = true;
  27. #endif
  28. }
  29. private:
  30. int m_nHARDWAREFOGBLEND;
  31. #ifdef _DEBUG
  32. bool m_bHARDWAREFOGBLEND;
  33. #endif
  34. public:
  35. void SetHARDWAREFOGBLEND( int i )
  36. {
  37. Assert( i >= 0 && i <= 0 );
  38. m_nHARDWAREFOGBLEND = i;
  39. #ifdef _DEBUG
  40. m_bHARDWAREFOGBLEND = true;
  41. #endif
  42. }
  43. void SetHARDWAREFOGBLEND( bool i )
  44. {
  45. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  46. m_nHARDWAREFOGBLEND = i ? 1 : 0;
  47. #ifdef _DEBUG
  48. m_bHARDWAREFOGBLEND = true;
  49. #endif
  50. }
  51. public:
  52. // CONSTRUCTOR
  53. worldimposter_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  54. {
  55. #ifdef _DEBUG
  56. m_bDOPIXELFOG = true;
  57. #endif // _DEBUG
  58. m_nDOPIXELFOG = 0; ;
  59. #ifdef _DEBUG
  60. m_bHARDWAREFOGBLEND = true;
  61. #endif // _DEBUG
  62. m_nHARDWAREFOGBLEND = 0 ;
  63. }
  64. int GetIndex()
  65. {
  66. // Asserts to make sure that we aren't using any skipped combinations.
  67. // Asserts to make sure that we are setting all of the combination vars.
  68. #ifdef _DEBUG
  69. bool bAllStaticVarsDefined = m_bDOPIXELFOG && m_bHARDWAREFOGBLEND;
  70. Assert( bAllStaticVarsDefined );
  71. #endif // _DEBUG
  72. return ( 8 * m_nDOPIXELFOG ) + ( 8 * m_nHARDWAREFOGBLEND ) + 0;
  73. }
  74. };
  75. #define shaderStaticTest_worldimposter_vs20 0
  76. class worldimposter_vs20_Dynamic_Index
  77. {
  78. private:
  79. int m_nDOWATERFOG;
  80. #ifdef _DEBUG
  81. bool m_bDOWATERFOG;
  82. #endif
  83. public:
  84. void SetDOWATERFOG( int i )
  85. {
  86. Assert( i >= 0 && i <= 0 );
  87. m_nDOWATERFOG = i;
  88. #ifdef _DEBUG
  89. m_bDOWATERFOG = true;
  90. #endif
  91. }
  92. void SetDOWATERFOG( bool i )
  93. {
  94. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  95. m_nDOWATERFOG = i ? 1 : 0;
  96. #ifdef _DEBUG
  97. m_bDOWATERFOG = true;
  98. #endif
  99. }
  100. private:
  101. int m_nSKINNING;
  102. #ifdef _DEBUG
  103. bool m_bSKINNING;
  104. #endif
  105. public:
  106. void SetSKINNING( int i )
  107. {
  108. Assert( i >= 0 && i <= 1 );
  109. m_nSKINNING = i;
  110. #ifdef _DEBUG
  111. m_bSKINNING = true;
  112. #endif
  113. }
  114. void SetSKINNING( bool i )
  115. {
  116. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  117. m_nSKINNING = i ? 1 : 0;
  118. #ifdef _DEBUG
  119. m_bSKINNING = true;
  120. #endif
  121. }
  122. private:
  123. int m_nCOMPRESSED_VERTS;
  124. #ifdef _DEBUG
  125. bool m_bCOMPRESSED_VERTS;
  126. #endif
  127. public:
  128. void SetCOMPRESSED_VERTS( int i )
  129. {
  130. Assert( i >= 0 && i <= 1 );
  131. m_nCOMPRESSED_VERTS = i;
  132. #ifdef _DEBUG
  133. m_bCOMPRESSED_VERTS = true;
  134. #endif
  135. }
  136. void SetCOMPRESSED_VERTS( bool i )
  137. {
  138. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  139. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  140. #ifdef _DEBUG
  141. m_bCOMPRESSED_VERTS = true;
  142. #endif
  143. }
  144. private:
  145. int m_nFLASHLIGHT;
  146. #ifdef _DEBUG
  147. bool m_bFLASHLIGHT;
  148. #endif
  149. public:
  150. void SetFLASHLIGHT( int i )
  151. {
  152. Assert( i >= 0 && i <= 1 );
  153. m_nFLASHLIGHT = i;
  154. #ifdef _DEBUG
  155. m_bFLASHLIGHT = true;
  156. #endif
  157. }
  158. void SetFLASHLIGHT( bool i )
  159. {
  160. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  161. m_nFLASHLIGHT = i ? 1 : 0;
  162. #ifdef _DEBUG
  163. m_bFLASHLIGHT = true;
  164. #endif
  165. }
  166. public:
  167. // CONSTRUCTOR
  168. worldimposter_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  169. {
  170. #ifdef _DEBUG
  171. m_bDOWATERFOG = true;
  172. #endif // _DEBUG
  173. m_nDOWATERFOG = 0; ;
  174. #ifdef _DEBUG
  175. m_bSKINNING = false;
  176. #endif // _DEBUG
  177. m_nSKINNING = 0;
  178. #ifdef _DEBUG
  179. m_bCOMPRESSED_VERTS = false;
  180. #endif // _DEBUG
  181. m_nCOMPRESSED_VERTS = 0;
  182. #ifdef _DEBUG
  183. m_bFLASHLIGHT = false;
  184. #endif // _DEBUG
  185. m_nFLASHLIGHT = 0;
  186. }
  187. int GetIndex()
  188. {
  189. // Asserts to make sure that we aren't using any skipped combinations.
  190. // Asserts to make sure that we are setting all of the combination vars.
  191. #ifdef _DEBUG
  192. bool bAllDynamicVarsDefined = m_bDOWATERFOG && m_bSKINNING && m_bCOMPRESSED_VERTS && m_bFLASHLIGHT;
  193. Assert( bAllDynamicVarsDefined );
  194. #endif // _DEBUG
  195. return ( 1 * m_nDOWATERFOG ) + ( 1 * m_nSKINNING ) + ( 2 * m_nCOMPRESSED_VERTS ) + ( 4 * m_nFLASHLIGHT ) + 0;
  196. }
  197. };
  198. #define shaderDynamicTest_worldimposter_vs20 vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_FLASHLIGHT + 0
  199. static const ShaderComboInformation_t s_DynamicComboArray_worldimposter_vs20[4] =
  200. {
  201. { "DOWATERFOG", 0, 0 },
  202. { "SKINNING", 0, 1 },
  203. { "COMPRESSED_VERTS", 0, 1 },
  204. { "FLASHLIGHT", 0, 1 },
  205. };
  206. static const ShaderComboInformation_t s_StaticComboArray_worldimposter_vs20[2] =
  207. {
  208. { "DOPIXELFOG", 0, 0 },
  209. { "HARDWAREFOGBLEND", 0, 0 },
  210. };
  211. static const ShaderComboSemantics_t worldimposter_vs20_combos =
  212. {
  213. "worldimposter_vs20", s_DynamicComboArray_worldimposter_vs20, 4, s_StaticComboArray_worldimposter_vs20, 2
  214. };
  215. class ConstructMe_worldimposter_vs20
  216. {
  217. public:
  218. ConstructMe_worldimposter_vs20()
  219. {
  220. GetShaderDLL()->AddShaderComboInformation( &worldimposter_vs20_combos );
  221. }
  222. };
  223. static ConstructMe_worldimposter_vs20 s_ConstructMe_worldimposter_vs20;