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.

176 lines
4.2 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  3. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  4. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  5. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  6. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  7. #include "shaderlib/cshader.h"
  8. class proto_ice_ps20b_Static_Index
  9. {
  10. private:
  11. int m_nVERTEXCOLOR;
  12. #ifdef _DEBUG
  13. bool m_bVERTEXCOLOR;
  14. #endif
  15. public:
  16. void SetVERTEXCOLOR( int i )
  17. {
  18. Assert( i >= 0 && i <= 1 );
  19. m_nVERTEXCOLOR = i;
  20. #ifdef _DEBUG
  21. m_bVERTEXCOLOR = true;
  22. #endif
  23. }
  24. void SetVERTEXCOLOR( bool i )
  25. {
  26. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  27. m_nVERTEXCOLOR = i ? 1 : 0;
  28. #ifdef _DEBUG
  29. m_bVERTEXCOLOR = true;
  30. #endif
  31. }
  32. private:
  33. int m_nBUMPMAP;
  34. #ifdef _DEBUG
  35. bool m_bBUMPMAP;
  36. #endif
  37. public:
  38. void SetBUMPMAP( int i )
  39. {
  40. Assert( i >= 0 && i <= 2 );
  41. m_nBUMPMAP = i;
  42. #ifdef _DEBUG
  43. m_bBUMPMAP = true;
  44. #endif
  45. }
  46. void SetBUMPMAP( bool i )
  47. {
  48. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 2 );
  49. m_nBUMPMAP = i ? 1 : 0;
  50. #ifdef _DEBUG
  51. m_bBUMPMAP = true;
  52. #endif
  53. }
  54. public:
  55. // CONSTRUCTOR
  56. proto_ice_ps20b_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  57. {
  58. #ifdef _DEBUG
  59. m_bVERTEXCOLOR = false;
  60. #endif // _DEBUG
  61. m_nVERTEXCOLOR = 0;
  62. #ifdef _DEBUG
  63. m_bBUMPMAP = false;
  64. #endif // _DEBUG
  65. m_nBUMPMAP = 0;
  66. }
  67. int GetIndex()
  68. {
  69. // Asserts to make sure that we aren't using any skipped combinations.
  70. // Asserts to make sure that we are setting all of the combination vars.
  71. #ifdef _DEBUG
  72. bool bAllStaticVarsDefined = m_bVERTEXCOLOR && m_bBUMPMAP;
  73. Assert( bAllStaticVarsDefined );
  74. #endif // _DEBUG
  75. return ( 10 * m_nVERTEXCOLOR ) + ( 20 * m_nBUMPMAP ) + 0;
  76. }
  77. };
  78. #define shaderStaticTest_proto_ice_ps20b psh_forgot_to_set_static_VERTEXCOLOR + psh_forgot_to_set_static_BUMPMAP + 0
  79. class proto_ice_ps20b_Dynamic_Index
  80. {
  81. private:
  82. int m_nNUM_LIGHTS;
  83. #ifdef _DEBUG
  84. bool m_bNUM_LIGHTS;
  85. #endif
  86. public:
  87. void SetNUM_LIGHTS( int i )
  88. {
  89. Assert( i >= 0 && i <= 4 );
  90. m_nNUM_LIGHTS = i;
  91. #ifdef _DEBUG
  92. m_bNUM_LIGHTS = true;
  93. #endif
  94. }
  95. void SetNUM_LIGHTS( bool i )
  96. {
  97. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 4 );
  98. m_nNUM_LIGHTS = i ? 1 : 0;
  99. #ifdef _DEBUG
  100. m_bNUM_LIGHTS = true;
  101. #endif
  102. }
  103. private:
  104. int m_nAMBIENT_LIGHT;
  105. #ifdef _DEBUG
  106. bool m_bAMBIENT_LIGHT;
  107. #endif
  108. public:
  109. void SetAMBIENT_LIGHT( int i )
  110. {
  111. Assert( i >= 0 && i <= 1 );
  112. m_nAMBIENT_LIGHT = i;
  113. #ifdef _DEBUG
  114. m_bAMBIENT_LIGHT = true;
  115. #endif
  116. }
  117. void SetAMBIENT_LIGHT( bool i )
  118. {
  119. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  120. m_nAMBIENT_LIGHT = i ? 1 : 0;
  121. #ifdef _DEBUG
  122. m_bAMBIENT_LIGHT = true;
  123. #endif
  124. }
  125. public:
  126. // CONSTRUCTOR
  127. proto_ice_ps20b_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  128. {
  129. #ifdef _DEBUG
  130. m_bNUM_LIGHTS = false;
  131. #endif // _DEBUG
  132. m_nNUM_LIGHTS = 0;
  133. #ifdef _DEBUG
  134. m_bAMBIENT_LIGHT = false;
  135. #endif // _DEBUG
  136. m_nAMBIENT_LIGHT = 0;
  137. }
  138. int GetIndex()
  139. {
  140. // Asserts to make sure that we aren't using any skipped combinations.
  141. // Asserts to make sure that we are setting all of the combination vars.
  142. #ifdef _DEBUG
  143. bool bAllDynamicVarsDefined = m_bNUM_LIGHTS && m_bAMBIENT_LIGHT;
  144. Assert( bAllDynamicVarsDefined );
  145. #endif // _DEBUG
  146. return ( 1 * m_nNUM_LIGHTS ) + ( 5 * m_nAMBIENT_LIGHT ) + 0;
  147. }
  148. };
  149. #define shaderDynamicTest_proto_ice_ps20b psh_forgot_to_set_dynamic_NUM_LIGHTS + psh_forgot_to_set_dynamic_AMBIENT_LIGHT + 0
  150. static const ShaderComboInformation_t s_DynamicComboArray_proto_ice_ps20b[2] =
  151. {
  152. { "NUM_LIGHTS", 0, 4 },
  153. { "AMBIENT_LIGHT", 0, 1 },
  154. };
  155. static const ShaderComboInformation_t s_StaticComboArray_proto_ice_ps20b[2] =
  156. {
  157. { "VERTEXCOLOR", 0, 1 },
  158. { "BUMPMAP", 0, 2 },
  159. };
  160. static const ShaderComboSemantics_t proto_ice_ps20b_combos =
  161. {
  162. "proto_ice_ps20b", s_DynamicComboArray_proto_ice_ps20b, 2, s_StaticComboArray_proto_ice_ps20b, 2
  163. };
  164. class ConstructMe_proto_ice_ps20b
  165. {
  166. public:
  167. ConstructMe_proto_ice_ps20b()
  168. {
  169. GetShaderDLL()->AddShaderComboInformation( &proto_ice_ps20b_combos );
  170. }
  171. };
  172. static ConstructMe_proto_ice_ps20b s_ConstructMe_proto_ice_ps20b;