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.

170 lines
4.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. #include "shaderlib/cshader.h"
  8. class teeth_bump_ps20b_Static_Index
  9. {
  10. public:
  11. // CONSTRUCTOR
  12. teeth_bump_ps20b_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  13. {
  14. }
  15. int GetIndex()
  16. {
  17. // Asserts to make sure that we aren't using any skipped combinations.
  18. // Asserts to make sure that we are setting all of the combination vars.
  19. #ifdef _DEBUG
  20. #endif // _DEBUG
  21. return 0;
  22. }
  23. };
  24. #define shaderStaticTest_teeth_bump_ps20b 0
  25. class teeth_bump_ps20b_Dynamic_Index
  26. {
  27. private:
  28. int m_nPIXELFOGTYPE;
  29. #ifdef _DEBUG
  30. bool m_bPIXELFOGTYPE;
  31. #endif
  32. public:
  33. void SetPIXELFOGTYPE( int i )
  34. {
  35. Assert( i >= 0 && i <= 1 );
  36. m_nPIXELFOGTYPE = i;
  37. #ifdef _DEBUG
  38. m_bPIXELFOGTYPE = true;
  39. #endif
  40. }
  41. void SetPIXELFOGTYPE( bool i )
  42. {
  43. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  44. m_nPIXELFOGTYPE = i ? 1 : 0;
  45. #ifdef _DEBUG
  46. m_bPIXELFOGTYPE = true;
  47. #endif
  48. }
  49. private:
  50. int m_nNUM_LIGHTS;
  51. #ifdef _DEBUG
  52. bool m_bNUM_LIGHTS;
  53. #endif
  54. public:
  55. void SetNUM_LIGHTS( int i )
  56. {
  57. Assert( i >= 0 && i <= 4 );
  58. m_nNUM_LIGHTS = i;
  59. #ifdef _DEBUG
  60. m_bNUM_LIGHTS = true;
  61. #endif
  62. }
  63. void SetNUM_LIGHTS( bool i )
  64. {
  65. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 4 );
  66. m_nNUM_LIGHTS = i ? 1 : 0;
  67. #ifdef _DEBUG
  68. m_bNUM_LIGHTS = true;
  69. #endif
  70. }
  71. private:
  72. int m_nAMBIENT_LIGHT;
  73. #ifdef _DEBUG
  74. bool m_bAMBIENT_LIGHT;
  75. #endif
  76. public:
  77. void SetAMBIENT_LIGHT( int i )
  78. {
  79. Assert( i >= 0 && i <= 1 );
  80. m_nAMBIENT_LIGHT = i;
  81. #ifdef _DEBUG
  82. m_bAMBIENT_LIGHT = true;
  83. #endif
  84. }
  85. void SetAMBIENT_LIGHT( bool i )
  86. {
  87. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
  88. m_nAMBIENT_LIGHT = i ? 1 : 0;
  89. #ifdef _DEBUG
  90. m_bAMBIENT_LIGHT = true;
  91. #endif
  92. }
  93. private:
  94. int m_nWRITE_DEPTH_TO_DESTALPHA;
  95. #ifdef _DEBUG
  96. bool m_bWRITE_DEPTH_TO_DESTALPHA;
  97. #endif
  98. public:
  99. void SetWRITE_DEPTH_TO_DESTALPHA( int i )
  100. {
  101. Assert( i >= 0 && i <= 0 );
  102. m_nWRITE_DEPTH_TO_DESTALPHA = i;
  103. #ifdef _DEBUG
  104. m_bWRITE_DEPTH_TO_DESTALPHA = true;
  105. #endif
  106. }
  107. void SetWRITE_DEPTH_TO_DESTALPHA( bool i )
  108. {
  109. Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
  110. m_nWRITE_DEPTH_TO_DESTALPHA = i ? 1 : 0;
  111. #ifdef _DEBUG
  112. m_bWRITE_DEPTH_TO_DESTALPHA = true;
  113. #endif
  114. }
  115. public:
  116. // CONSTRUCTOR
  117. teeth_bump_ps20b_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  118. {
  119. #ifdef _DEBUG
  120. m_bPIXELFOGTYPE = true;
  121. #endif // _DEBUG
  122. m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  123. #ifdef _DEBUG
  124. m_bNUM_LIGHTS = false;
  125. #endif // _DEBUG
  126. m_nNUM_LIGHTS = 0;
  127. #ifdef _DEBUG
  128. m_bAMBIENT_LIGHT = false;
  129. #endif // _DEBUG
  130. m_nAMBIENT_LIGHT = 0;
  131. #ifdef _DEBUG
  132. m_bWRITE_DEPTH_TO_DESTALPHA = false;
  133. #endif // _DEBUG
  134. m_nWRITE_DEPTH_TO_DESTALPHA = 0;
  135. }
  136. int GetIndex()
  137. {
  138. // Asserts to make sure that we aren't using any skipped combinations.
  139. // Asserts to make sure that we are setting all of the combination vars.
  140. #ifdef _DEBUG
  141. bool bAllDynamicVarsDefined = m_bPIXELFOGTYPE && m_bNUM_LIGHTS && m_bAMBIENT_LIGHT && m_bWRITE_DEPTH_TO_DESTALPHA;
  142. Assert( bAllDynamicVarsDefined );
  143. #endif // _DEBUG
  144. return ( 1 * m_nPIXELFOGTYPE ) + ( 2 * m_nNUM_LIGHTS ) + ( 10 * m_nAMBIENT_LIGHT ) + ( 20 * m_nWRITE_DEPTH_TO_DESTALPHA ) + 0;
  145. }
  146. };
  147. #define shaderDynamicTest_teeth_bump_ps20b psh_forgot_to_set_dynamic_NUM_LIGHTS + psh_forgot_to_set_dynamic_AMBIENT_LIGHT + psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + 0
  148. static const ShaderComboInformation_t s_DynamicComboArray_teeth_bump_ps20b[4] =
  149. {
  150. { "PIXELFOGTYPE", 0, 1 },
  151. { "NUM_LIGHTS", 0, 4 },
  152. { "AMBIENT_LIGHT", 0, 1 },
  153. { "WRITE_DEPTH_TO_DESTALPHA", 0, 0 },
  154. };
  155. static const ShaderComboSemantics_t teeth_bump_ps20b_combos =
  156. {
  157. "teeth_bump_ps20b", s_DynamicComboArray_teeth_bump_ps20b, 4, NULL, 0
  158. };
  159. class ConstructMe_teeth_bump_ps20b
  160. {
  161. public:
  162. ConstructMe_teeth_bump_ps20b()
  163. {
  164. GetShaderDLL()->AddShaderComboInformation( &teeth_bump_ps20b_combos );
  165. }
  166. };
  167. static ConstructMe_teeth_bump_ps20b s_ConstructMe_teeth_bump_ps20b;