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.

201 lines
4.7 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. public:
  31. // CONSTRUCTOR
  32. unlittwotexture_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  33. {
  34. #ifdef _DEBUG
  35. m_bDOPIXELFOG = true;
  36. #endif // _DEBUG
  37. m_nDOPIXELFOG = g_pHardwareConfig->SupportsPixelShaders_2_b() ;
  38. }
  39. int GetIndex()
  40. {
  41. // Asserts to make sure that we aren't using any skipped combinations.
  42. // Asserts to make sure that we are setting all of the combination vars.
  43. #ifdef _DEBUG
  44. bool bAllStaticVarsDefined = m_bDOPIXELFOG;
  45. Assert( bAllStaticVarsDefined );
  46. #endif // _DEBUG
  47. return ( 8 * m_nDOPIXELFOG ) + 0;
  48. }
  49. };
  50. #define shaderStaticTest_unlittwotexture_vs20 0
  51. class unlittwotexture_vs20_Dynamic_Index
  52. {
  53. private:
  54. int m_nCOMPRESSED_VERTS;
  55. #ifdef _DEBUG
  56. bool m_bCOMPRESSED_VERTS;
  57. #endif
  58. public:
  59. void SetCOMPRESSED_VERTS( int i )
  60. {
  61. Assert( i >= 0 && i <= 1 );
  62. m_nCOMPRESSED_VERTS = i;
  63. #ifdef _DEBUG
  64. m_bCOMPRESSED_VERTS = true;
  65. #endif
  66. }
  67. void SetCOMPRESSED_VERTS( bool i )
  68. {
  69. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  70. m_nCOMPRESSED_VERTS = i ? 1 : 0;
  71. #ifdef _DEBUG
  72. m_bCOMPRESSED_VERTS = true;
  73. #endif
  74. }
  75. private:
  76. int m_nDOWATERFOG;
  77. #ifdef _DEBUG
  78. bool m_bDOWATERFOG;
  79. #endif
  80. public:
  81. void SetDOWATERFOG( int i )
  82. {
  83. Assert( i >= 0 && i <= 1 );
  84. m_nDOWATERFOG = i;
  85. #ifdef _DEBUG
  86. m_bDOWATERFOG = true;
  87. #endif
  88. }
  89. void SetDOWATERFOG( bool i )
  90. {
  91. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  92. m_nDOWATERFOG = i ? 1 : 0;
  93. #ifdef _DEBUG
  94. m_bDOWATERFOG = true;
  95. #endif
  96. }
  97. private:
  98. int m_nSKINNING;
  99. #ifdef _DEBUG
  100. bool m_bSKINNING;
  101. #endif
  102. public:
  103. void SetSKINNING( int i )
  104. {
  105. Assert( i >= 0 && i <= 1 );
  106. m_nSKINNING = i;
  107. #ifdef _DEBUG
  108. m_bSKINNING = true;
  109. #endif
  110. }
  111. void SetSKINNING( bool i )
  112. {
  113. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  114. m_nSKINNING = i ? 1 : 0;
  115. #ifdef _DEBUG
  116. m_bSKINNING = true;
  117. #endif
  118. }
  119. private:
  120. int m_nWORLD_NORMAL;
  121. #ifdef _DEBUG
  122. bool m_bWORLD_NORMAL;
  123. #endif
  124. public:
  125. void SetWORLD_NORMAL( int i )
  126. {
  127. Assert( i >= 0 && i <= 0 );
  128. m_nWORLD_NORMAL = i;
  129. #ifdef _DEBUG
  130. m_bWORLD_NORMAL = true;
  131. #endif
  132. }
  133. void SetWORLD_NORMAL( bool i )
  134. {
  135. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  136. m_nWORLD_NORMAL = i ? 1 : 0;
  137. #ifdef _DEBUG
  138. m_bWORLD_NORMAL = true;
  139. #endif
  140. }
  141. public:
  142. // CONSTRUCTOR
  143. unlittwotexture_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  144. {
  145. #ifdef _DEBUG
  146. m_bCOMPRESSED_VERTS = false;
  147. #endif // _DEBUG
  148. m_nCOMPRESSED_VERTS = 0;
  149. #ifdef _DEBUG
  150. m_bDOWATERFOG = true;
  151. #endif // _DEBUG
  152. m_nDOWATERFOG = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  153. #ifdef _DEBUG
  154. m_bSKINNING = false;
  155. #endif // _DEBUG
  156. m_nSKINNING = 0;
  157. #ifdef _DEBUG
  158. m_bWORLD_NORMAL = false;
  159. #endif // _DEBUG
  160. m_nWORLD_NORMAL = 0;
  161. }
  162. int GetIndex()
  163. {
  164. // Asserts to make sure that we aren't using any skipped combinations.
  165. // Asserts to make sure that we are setting all of the combination vars.
  166. #ifdef _DEBUG
  167. bool bAllDynamicVarsDefined = m_bCOMPRESSED_VERTS && m_bDOWATERFOG && m_bSKINNING && m_bWORLD_NORMAL;
  168. Assert( bAllDynamicVarsDefined );
  169. #endif // _DEBUG
  170. return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDOWATERFOG ) + ( 4 * m_nSKINNING ) + ( 8 * m_nWORLD_NORMAL ) + 0;
  171. }
  172. };
  173. #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
  174. static const ShaderComboInformation_t s_DynamicComboArray_unlittwotexture_vs20[4] =
  175. {
  176. { "COMPRESSED_VERTS", 0, 1 },
  177. { "DOWATERFOG", 0, 1 },
  178. { "SKINNING", 0, 1 },
  179. { "WORLD_NORMAL", 0, 0 },
  180. };
  181. static const ShaderComboInformation_t s_StaticComboArray_unlittwotexture_vs20[1] =
  182. {
  183. { "DOPIXELFOG", 0, 1 },
  184. };
  185. static const ShaderComboSemantics_t unlittwotexture_vs20_combos =
  186. {
  187. "unlittwotexture_vs20", s_DynamicComboArray_unlittwotexture_vs20, 4, s_StaticComboArray_unlittwotexture_vs20, 1
  188. };
  189. class ConstructMe_unlittwotexture_vs20
  190. {
  191. public:
  192. ConstructMe_unlittwotexture_vs20()
  193. {
  194. GetShaderDLL()->AddShaderComboInformation( &unlittwotexture_vs20_combos );
  195. }
  196. };
  197. static ConstructMe_unlittwotexture_vs20 s_ConstructMe_unlittwotexture_vs20;