Team Fortress 2 Source Code as on 22/4/2020
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.

162 lines
3.5 KiB

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