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.

208 lines
5.3 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. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  8. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  9. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  10. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  11. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  12. #include "shaderlib/cshader.h"
  13. class lightmappedreflective_ps20_Static_Index
  14. {
  15. private:
  16. int m_nBASETEXTURE;
  17. #ifdef _DEBUG
  18. bool m_bBASETEXTURE;
  19. #endif
  20. public:
  21. void SetBASETEXTURE( int i )
  22. {
  23. Assert( i >= 0 && i <= 1 );
  24. m_nBASETEXTURE = i;
  25. #ifdef _DEBUG
  26. m_bBASETEXTURE = true;
  27. #endif
  28. }
  29. void SetBASETEXTURE( bool i )
  30. {
  31. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  32. m_nBASETEXTURE = i ? 1 : 0;
  33. #ifdef _DEBUG
  34. m_bBASETEXTURE = true;
  35. #endif
  36. }
  37. private:
  38. int m_nREFLECT;
  39. #ifdef _DEBUG
  40. bool m_bREFLECT;
  41. #endif
  42. public:
  43. void SetREFLECT( int i )
  44. {
  45. Assert( i >= 0 && i <= 1 );
  46. m_nREFLECT = i;
  47. #ifdef _DEBUG
  48. m_bREFLECT = true;
  49. #endif
  50. }
  51. void SetREFLECT( bool i )
  52. {
  53. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  54. m_nREFLECT = i ? 1 : 0;
  55. #ifdef _DEBUG
  56. m_bREFLECT = true;
  57. #endif
  58. }
  59. private:
  60. int m_nREFRACT;
  61. #ifdef _DEBUG
  62. bool m_bREFRACT;
  63. #endif
  64. public:
  65. void SetREFRACT( int i )
  66. {
  67. Assert( i >= 0 && i <= 1 );
  68. m_nREFRACT = i;
  69. #ifdef _DEBUG
  70. m_bREFRACT = true;
  71. #endif
  72. }
  73. void SetREFRACT( bool i )
  74. {
  75. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  76. m_nREFRACT = i ? 1 : 0;
  77. #ifdef _DEBUG
  78. m_bREFRACT = true;
  79. #endif
  80. }
  81. private:
  82. int m_nENVMAPMASK;
  83. #ifdef _DEBUG
  84. bool m_bENVMAPMASK;
  85. #endif
  86. public:
  87. void SetENVMAPMASK( int i )
  88. {
  89. Assert( i >= 0 && i <= 1 );
  90. m_nENVMAPMASK = i;
  91. #ifdef _DEBUG
  92. m_bENVMAPMASK = true;
  93. #endif
  94. }
  95. void SetENVMAPMASK( bool i )
  96. {
  97. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  98. m_nENVMAPMASK = i ? 1 : 0;
  99. #ifdef _DEBUG
  100. m_bENVMAPMASK = true;
  101. #endif
  102. }
  103. public:
  104. // CONSTRUCTOR
  105. lightmappedreflective_ps20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  106. {
  107. #ifdef _DEBUG
  108. m_bBASETEXTURE = false;
  109. #endif // _DEBUG
  110. m_nBASETEXTURE = 0;
  111. #ifdef _DEBUG
  112. m_bREFLECT = false;
  113. #endif // _DEBUG
  114. m_nREFLECT = 0;
  115. #ifdef _DEBUG
  116. m_bREFRACT = false;
  117. #endif // _DEBUG
  118. m_nREFRACT = 0;
  119. #ifdef _DEBUG
  120. m_bENVMAPMASK = false;
  121. #endif // _DEBUG
  122. m_nENVMAPMASK = 0;
  123. }
  124. int GetIndex()
  125. {
  126. // Asserts to make sure that we aren't using any skipped combinations.
  127. // Asserts to make sure that we are setting all of the combination vars.
  128. #ifdef _DEBUG
  129. bool bAllStaticVarsDefined = m_bBASETEXTURE && m_bREFLECT && m_bREFRACT && m_bENVMAPMASK;
  130. Assert( bAllStaticVarsDefined );
  131. #endif // _DEBUG
  132. return ( 2 * m_nBASETEXTURE ) + ( 4 * m_nREFLECT ) + ( 8 * m_nREFRACT ) + ( 16 * m_nENVMAPMASK ) + 0;
  133. }
  134. };
  135. #define shaderStaticTest_lightmappedreflective_ps20 psh_forgot_to_set_static_BASETEXTURE + psh_forgot_to_set_static_REFLECT + psh_forgot_to_set_static_REFRACT + psh_forgot_to_set_static_ENVMAPMASK + 0
  136. class lightmappedreflective_ps20_Dynamic_Index
  137. {
  138. private:
  139. int m_nPIXELFOGTYPE;
  140. #ifdef _DEBUG
  141. bool m_bPIXELFOGTYPE;
  142. #endif
  143. public:
  144. void SetPIXELFOGTYPE( int i )
  145. {
  146. Assert( i >= 0 && i <= 1 );
  147. m_nPIXELFOGTYPE = i;
  148. #ifdef _DEBUG
  149. m_bPIXELFOGTYPE = true;
  150. #endif
  151. }
  152. void SetPIXELFOGTYPE( bool i )
  153. {
  154. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  155. m_nPIXELFOGTYPE = i ? 1 : 0;
  156. #ifdef _DEBUG
  157. m_bPIXELFOGTYPE = true;
  158. #endif
  159. }
  160. public:
  161. // CONSTRUCTOR
  162. lightmappedreflective_ps20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  163. {
  164. #ifdef _DEBUG
  165. m_bPIXELFOGTYPE = true;
  166. #endif // _DEBUG
  167. m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  168. }
  169. int GetIndex()
  170. {
  171. // Asserts to make sure that we aren't using any skipped combinations.
  172. // Asserts to make sure that we are setting all of the combination vars.
  173. #ifdef _DEBUG
  174. bool bAllDynamicVarsDefined = m_bPIXELFOGTYPE;
  175. Assert( bAllDynamicVarsDefined );
  176. #endif // _DEBUG
  177. return ( 1 * m_nPIXELFOGTYPE ) + 0;
  178. }
  179. };
  180. #define shaderDynamicTest_lightmappedreflective_ps20 0
  181. static const ShaderComboInformation_t s_DynamicComboArray_lightmappedreflective_ps20[1] =
  182. {
  183. { "PIXELFOGTYPE", 0, 1 },
  184. };
  185. static const ShaderComboInformation_t s_StaticComboArray_lightmappedreflective_ps20[4] =
  186. {
  187. { "BASETEXTURE", 0, 1 },
  188. { "REFLECT", 0, 1 },
  189. { "REFRACT", 0, 1 },
  190. { "ENVMAPMASK", 0, 1 },
  191. };
  192. static const ShaderComboSemantics_t lightmappedreflective_ps20_combos =
  193. {
  194. "lightmappedreflective_ps20", s_DynamicComboArray_lightmappedreflective_ps20, 1, s_StaticComboArray_lightmappedreflective_ps20, 4
  195. };
  196. class ConstructMe_lightmappedreflective_ps20
  197. {
  198. public:
  199. ConstructMe_lightmappedreflective_ps20()
  200. {
  201. GetShaderDLL()->AddShaderComboInformation( &lightmappedreflective_ps20_combos );
  202. }
  203. };
  204. static ConstructMe_lightmappedreflective_ps20 s_ConstructMe_lightmappedreflective_ps20;