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.

186 lines
5.4 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( $PAINTSTYLE == 0 )
  3. // ( ( $CHEAPMODE == 1 ) && !( ( $PAINTSTYLE == 3 ) || ( $PAINTSTYLE == 6 ) ) )
  4. // ( ( $EXPONENTMODE == 1 ) && ( $CHEAPMODE == 1 ) )
  5. // ( ( $NUM_LIGHTS != 0 ) && ( $PREVIEW == 0 ) )
  6. // ( ( $PREVIEW == 0 ) && ( $PREVIEWPHONGALBEDOTINT == 1 ) )
  7. // ( ( $PREVIEW == 1 ) && ( $EXPONENTMODE == 1 ) )
  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. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  14. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  15. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  16. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  17. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  18. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  19. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  20. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  21. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  22. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  23. #include "shaderlib/cshader.h"
  24. class customweapon_ps20b_Static_Index
  25. {
  26. private:
  27. int m_nPAINTSTYLE;
  28. #ifdef _DEBUG
  29. bool m_bPAINTSTYLE;
  30. #endif
  31. public:
  32. void SetPAINTSTYLE( int i )
  33. {
  34. Assert( i >= 0 && i <= 9 );
  35. m_nPAINTSTYLE = i;
  36. #ifdef _DEBUG
  37. m_bPAINTSTYLE = true;
  38. #endif
  39. }
  40. void SetPAINTSTYLE( bool i )
  41. {
  42. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 9 );
  43. m_nPAINTSTYLE = i ? 1 : 0;
  44. #ifdef _DEBUG
  45. m_bPAINTSTYLE = true;
  46. #endif
  47. }
  48. private:
  49. int m_nEXPONENTMODE;
  50. #ifdef _DEBUG
  51. bool m_bEXPONENTMODE;
  52. #endif
  53. public:
  54. void SetEXPONENTMODE( int i )
  55. {
  56. Assert( i >= 0 && i <= 1 );
  57. m_nEXPONENTMODE = i;
  58. #ifdef _DEBUG
  59. m_bEXPONENTMODE = true;
  60. #endif
  61. }
  62. void SetEXPONENTMODE( bool i )
  63. {
  64. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  65. m_nEXPONENTMODE = i ? 1 : 0;
  66. #ifdef _DEBUG
  67. m_bEXPONENTMODE = true;
  68. #endif
  69. }
  70. private:
  71. int m_nCHEAPMODE;
  72. #ifdef _DEBUG
  73. bool m_bCHEAPMODE;
  74. #endif
  75. public:
  76. void SetCHEAPMODE( int i )
  77. {
  78. Assert( i >= 0 && i <= 1 );
  79. m_nCHEAPMODE = i;
  80. #ifdef _DEBUG
  81. m_bCHEAPMODE = true;
  82. #endif
  83. }
  84. void SetCHEAPMODE( bool i )
  85. {
  86. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  87. m_nCHEAPMODE = i ? 1 : 0;
  88. #ifdef _DEBUG
  89. m_bCHEAPMODE = true;
  90. #endif
  91. }
  92. private:
  93. int m_nPHONGALBEDOFACTORMODE;
  94. #ifdef _DEBUG
  95. bool m_bPHONGALBEDOFACTORMODE;
  96. #endif
  97. public:
  98. void SetPHONGALBEDOFACTORMODE( int i )
  99. {
  100. Assert( i >= 0 && i <= 1 );
  101. m_nPHONGALBEDOFACTORMODE = i;
  102. #ifdef _DEBUG
  103. m_bPHONGALBEDOFACTORMODE = true;
  104. #endif
  105. }
  106. void SetPHONGALBEDOFACTORMODE( bool i )
  107. {
  108. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  109. m_nPHONGALBEDOFACTORMODE = i ? 1 : 0;
  110. #ifdef _DEBUG
  111. m_bPHONGALBEDOFACTORMODE = true;
  112. #endif
  113. }
  114. public:
  115. // CONSTRUCTOR
  116. customweapon_ps20b_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  117. {
  118. #ifdef _DEBUG
  119. m_bPAINTSTYLE = false;
  120. #endif // _DEBUG
  121. m_nPAINTSTYLE = 0;
  122. #ifdef _DEBUG
  123. m_bEXPONENTMODE = false;
  124. #endif // _DEBUG
  125. m_nEXPONENTMODE = 0;
  126. #ifdef _DEBUG
  127. m_bCHEAPMODE = false;
  128. #endif // _DEBUG
  129. m_nCHEAPMODE = 0;
  130. #ifdef _DEBUG
  131. m_bPHONGALBEDOFACTORMODE = false;
  132. #endif // _DEBUG
  133. m_nPHONGALBEDOFACTORMODE = 0;
  134. }
  135. int GetIndex()
  136. {
  137. // Asserts to make sure that we aren't using any skipped combinations.
  138. // Asserts to make sure that we are setting all of the combination vars.
  139. #ifdef _DEBUG
  140. bool bAllStaticVarsDefined = m_bPAINTSTYLE && m_bEXPONENTMODE && m_bCHEAPMODE && m_bPHONGALBEDOFACTORMODE;
  141. Assert( bAllStaticVarsDefined );
  142. #endif // _DEBUG
  143. return ( 1 * m_nPAINTSTYLE ) + ( 10 * m_nEXPONENTMODE ) + ( 20 * m_nCHEAPMODE ) + ( 40 * m_nPHONGALBEDOFACTORMODE ) + 0;
  144. }
  145. };
  146. #define shaderStaticTest_customweapon_ps20b psh_forgot_to_set_static_PAINTSTYLE + psh_forgot_to_set_static_EXPONENTMODE + psh_forgot_to_set_static_CHEAPMODE + psh_forgot_to_set_static_PHONGALBEDOFACTORMODE + 0
  147. class customweapon_ps20b_Dynamic_Index
  148. {
  149. public:
  150. // CONSTRUCTOR
  151. customweapon_ps20b_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  152. {
  153. }
  154. int GetIndex()
  155. {
  156. // Asserts to make sure that we aren't using any skipped combinations.
  157. // Asserts to make sure that we are setting all of the combination vars.
  158. #ifdef _DEBUG
  159. #endif // _DEBUG
  160. return 0;
  161. }
  162. };
  163. #define shaderDynamicTest_customweapon_ps20b 0
  164. static const ShaderComboInformation_t s_StaticComboArray_customweapon_ps20b[4] =
  165. {
  166. { "PAINTSTYLE", 0, 9 },
  167. { "EXPONENTMODE", 0, 1 },
  168. { "CHEAPMODE", 0, 1 },
  169. { "PHONGALBEDOFACTORMODE", 0, 1 },
  170. };
  171. static const ShaderComboSemantics_t customweapon_ps20b_combos =
  172. {
  173. "customweapon_ps20b", NULL, 0, s_StaticComboArray_customweapon_ps20b, 4
  174. };
  175. class ConstructMe_customweapon_ps20b
  176. {
  177. public:
  178. ConstructMe_customweapon_ps20b()
  179. {
  180. GetShaderDLL()->AddShaderComboInformation( &customweapon_ps20b_combos );
  181. }
  182. };
  183. static ConstructMe_customweapon_ps20b s_ConstructMe_customweapon_ps20b;