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.

130 lines
4.0 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. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  13. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  14. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  15. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  16. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  17. #include "shaderlib/cshader.h"
  18. class manifoldsurface_ps30_Static_Index
  19. {
  20. private:
  21. int m_nLIGHT_LUT_TYPE;
  22. #ifdef _DEBUG
  23. bool m_bLIGHT_LUT_TYPE;
  24. #endif
  25. public:
  26. void SetLIGHT_LUT_TYPE( int i )
  27. {
  28. Assert( i >= 0 && i <= 1 );
  29. m_nLIGHT_LUT_TYPE = i;
  30. #ifdef _DEBUG
  31. m_bLIGHT_LUT_TYPE = true;
  32. #endif
  33. }
  34. void SetLIGHT_LUT_TYPE( bool i )
  35. {
  36. m_nLIGHT_LUT_TYPE = i ? 1 : 0;
  37. #ifdef _DEBUG
  38. m_bLIGHT_LUT_TYPE = true;
  39. #endif
  40. }
  41. private:
  42. int m_nHIGH_PRECISION_DEPTH;
  43. #ifdef _DEBUG
  44. bool m_bHIGH_PRECISION_DEPTH;
  45. #endif
  46. public:
  47. void SetHIGH_PRECISION_DEPTH( int i )
  48. {
  49. Assert( i >= 0 && i <= 1 );
  50. m_nHIGH_PRECISION_DEPTH = i;
  51. #ifdef _DEBUG
  52. m_bHIGH_PRECISION_DEPTH = true;
  53. #endif
  54. }
  55. void SetHIGH_PRECISION_DEPTH( bool i )
  56. {
  57. m_nHIGH_PRECISION_DEPTH = i ? 1 : 0;
  58. #ifdef _DEBUG
  59. m_bHIGH_PRECISION_DEPTH = true;
  60. #endif
  61. }
  62. public:
  63. // CONSTRUCTOR
  64. manifoldsurface_ps30_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  65. {
  66. #ifdef _DEBUG
  67. m_bLIGHT_LUT_TYPE = false;
  68. #endif // _DEBUG
  69. m_nLIGHT_LUT_TYPE = 0;
  70. #ifdef _DEBUG
  71. m_bHIGH_PRECISION_DEPTH = false;
  72. #endif // _DEBUG
  73. m_nHIGH_PRECISION_DEPTH = 0;
  74. }
  75. int GetIndex()
  76. {
  77. // Asserts to make sure that we aren't using any skipped combinations.
  78. // Asserts to make sure that we are setting all of the combination vars.
  79. #ifdef _DEBUG
  80. bool bAllStaticVarsDefined = m_bLIGHT_LUT_TYPE && m_bHIGH_PRECISION_DEPTH;
  81. Assert( bAllStaticVarsDefined );
  82. #endif // _DEBUG
  83. return ( 5 * m_nLIGHT_LUT_TYPE ) + ( 10 * m_nHIGH_PRECISION_DEPTH ) + 0;
  84. }
  85. };
  86. #define shaderStaticTest_manifoldsurface_ps30 psh_forgot_to_set_static_LIGHT_LUT_TYPE + psh_forgot_to_set_static_HIGH_PRECISION_DEPTH + 0
  87. class manifoldsurface_ps30_Dynamic_Index
  88. {
  89. private:
  90. int m_nNUM_LIGHTS;
  91. #ifdef _DEBUG
  92. bool m_bNUM_LIGHTS;
  93. #endif
  94. public:
  95. void SetNUM_LIGHTS( int i )
  96. {
  97. Assert( i >= 0 && i <= 4 );
  98. m_nNUM_LIGHTS = i;
  99. #ifdef _DEBUG
  100. m_bNUM_LIGHTS = true;
  101. #endif
  102. }
  103. void SetNUM_LIGHTS( bool i )
  104. {
  105. m_nNUM_LIGHTS = i ? 1 : 0;
  106. #ifdef _DEBUG
  107. m_bNUM_LIGHTS = true;
  108. #endif
  109. }
  110. public:
  111. // CONSTRUCTOR
  112. manifoldsurface_ps30_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  113. {
  114. #ifdef _DEBUG
  115. m_bNUM_LIGHTS = false;
  116. #endif // _DEBUG
  117. m_nNUM_LIGHTS = 0;
  118. }
  119. int GetIndex()
  120. {
  121. // Asserts to make sure that we aren't using any skipped combinations.
  122. // Asserts to make sure that we are setting all of the combination vars.
  123. #ifdef _DEBUG
  124. bool bAllDynamicVarsDefined = m_bNUM_LIGHTS;
  125. Assert( bAllDynamicVarsDefined );
  126. #endif // _DEBUG
  127. return ( 1 * m_nNUM_LIGHTS ) + 0;
  128. }
  129. };
  130. #define shaderDynamicTest_manifoldsurface_ps30 psh_forgot_to_set_dynamic_NUM_LIGHTS + 0