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.

228 lines
5.3 KiB

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