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.

665 lines
15 KiB

  1. // ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
  2. // ( $FLASHLIGHT != 0 ) && ( $NUM_LIGHTS > 0 )
  3. // ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTSHADOWS == 1 )
  4. // (! $DETAILTEXTURE) && ( $DETAIL_BLEND_MODE != 0 )
  5. // ( $SELFILLUMFRESNEL == 1 ) && ( $LIGHTWARPTEXTURE == 1 )
  6. // ( $SELFILLUM == 0 ) && ( $SELFILLUMFRESNEL == 1 )
  7. // ( $FLASHLIGHT == 1 ) && ( $SELFILLUMFRESNEL == 1 )
  8. // ( $SELFILLUMFRESNEL == 1 ) && ( $DETAILTEXTURE == 1 )
  9. // ( $SELFILLUMFRESNEL == 1 ) && ( $NORMALMAPALPHAENVMAPMASK == 1 )
  10. // $NEBULA && ( $DETAILTEXTURE || $FLOWMAP || $DAMAGED )
  11. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  12. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  13. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  14. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  15. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  16. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  17. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  18. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  19. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  20. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  21. // defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
  22. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
  23. // defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
  24. // defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
  25. // ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
  26. // ( $FLOWMAP == 0 ) && ( $FLOW_DEBUG > 0 )
  27. #include "shaderlib/cshader.h"
  28. class vertexlit_sob_ps30_Static_Index
  29. {
  30. private:
  31. int m_nCUBEMAP;
  32. #ifdef _DEBUG
  33. bool m_bCUBEMAP;
  34. #endif
  35. public:
  36. void SetCUBEMAP( int i )
  37. {
  38. Assert( i >= 0 && i <= 1 );
  39. m_nCUBEMAP = i;
  40. #ifdef _DEBUG
  41. m_bCUBEMAP = true;
  42. #endif
  43. }
  44. void SetCUBEMAP( bool i )
  45. {
  46. m_nCUBEMAP = i ? 1 : 0;
  47. #ifdef _DEBUG
  48. m_bCUBEMAP = true;
  49. #endif
  50. }
  51. private:
  52. int m_nLIGHTWARPTEXTURE;
  53. #ifdef _DEBUG
  54. bool m_bLIGHTWARPTEXTURE;
  55. #endif
  56. public:
  57. void SetLIGHTWARPTEXTURE( int i )
  58. {
  59. Assert( i >= 0 && i <= 1 );
  60. m_nLIGHTWARPTEXTURE = i;
  61. #ifdef _DEBUG
  62. m_bLIGHTWARPTEXTURE = true;
  63. #endif
  64. }
  65. void SetLIGHTWARPTEXTURE( bool i )
  66. {
  67. m_nLIGHTWARPTEXTURE = i ? 1 : 0;
  68. #ifdef _DEBUG
  69. m_bLIGHTWARPTEXTURE = true;
  70. #endif
  71. }
  72. private:
  73. int m_nSELFILLUM;
  74. #ifdef _DEBUG
  75. bool m_bSELFILLUM;
  76. #endif
  77. public:
  78. void SetSELFILLUM( int i )
  79. {
  80. Assert( i >= 0 && i <= 1 );
  81. m_nSELFILLUM = i;
  82. #ifdef _DEBUG
  83. m_bSELFILLUM = true;
  84. #endif
  85. }
  86. void SetSELFILLUM( bool i )
  87. {
  88. m_nSELFILLUM = i ? 1 : 0;
  89. #ifdef _DEBUG
  90. m_bSELFILLUM = true;
  91. #endif
  92. }
  93. private:
  94. int m_nSELFILLUMFRESNEL;
  95. #ifdef _DEBUG
  96. bool m_bSELFILLUMFRESNEL;
  97. #endif
  98. public:
  99. void SetSELFILLUMFRESNEL( int i )
  100. {
  101. Assert( i >= 0 && i <= 1 );
  102. m_nSELFILLUMFRESNEL = i;
  103. #ifdef _DEBUG
  104. m_bSELFILLUMFRESNEL = true;
  105. #endif
  106. }
  107. void SetSELFILLUMFRESNEL( bool i )
  108. {
  109. m_nSELFILLUMFRESNEL = i ? 1 : 0;
  110. #ifdef _DEBUG
  111. m_bSELFILLUMFRESNEL = true;
  112. #endif
  113. }
  114. private:
  115. int m_nNORMALMAPALPHAENVMAPMASK;
  116. #ifdef _DEBUG
  117. bool m_bNORMALMAPALPHAENVMAPMASK;
  118. #endif
  119. public:
  120. void SetNORMALMAPALPHAENVMAPMASK( int i )
  121. {
  122. Assert( i >= 0 && i <= 1 );
  123. m_nNORMALMAPALPHAENVMAPMASK = i;
  124. #ifdef _DEBUG
  125. m_bNORMALMAPALPHAENVMAPMASK = true;
  126. #endif
  127. }
  128. void SetNORMALMAPALPHAENVMAPMASK( bool i )
  129. {
  130. m_nNORMALMAPALPHAENVMAPMASK = i ? 1 : 0;
  131. #ifdef _DEBUG
  132. m_bNORMALMAPALPHAENVMAPMASK = true;
  133. #endif
  134. }
  135. private:
  136. int m_nHALFLAMBERT;
  137. #ifdef _DEBUG
  138. bool m_bHALFLAMBERT;
  139. #endif
  140. public:
  141. void SetHALFLAMBERT( int i )
  142. {
  143. Assert( i >= 0 && i <= 1 );
  144. m_nHALFLAMBERT = i;
  145. #ifdef _DEBUG
  146. m_bHALFLAMBERT = true;
  147. #endif
  148. }
  149. void SetHALFLAMBERT( bool i )
  150. {
  151. m_nHALFLAMBERT = i ? 1 : 0;
  152. #ifdef _DEBUG
  153. m_bHALFLAMBERT = true;
  154. #endif
  155. }
  156. private:
  157. int m_nFLASHLIGHT;
  158. #ifdef _DEBUG
  159. bool m_bFLASHLIGHT;
  160. #endif
  161. public:
  162. void SetFLASHLIGHT( int i )
  163. {
  164. Assert( i >= 0 && i <= 1 );
  165. m_nFLASHLIGHT = i;
  166. #ifdef _DEBUG
  167. m_bFLASHLIGHT = true;
  168. #endif
  169. }
  170. void SetFLASHLIGHT( bool i )
  171. {
  172. m_nFLASHLIGHT = i ? 1 : 0;
  173. #ifdef _DEBUG
  174. m_bFLASHLIGHT = true;
  175. #endif
  176. }
  177. private:
  178. int m_nDETAILTEXTURE;
  179. #ifdef _DEBUG
  180. bool m_bDETAILTEXTURE;
  181. #endif
  182. public:
  183. void SetDETAILTEXTURE( int i )
  184. {
  185. Assert( i >= 0 && i <= 1 );
  186. m_nDETAILTEXTURE = i;
  187. #ifdef _DEBUG
  188. m_bDETAILTEXTURE = true;
  189. #endif
  190. }
  191. void SetDETAILTEXTURE( bool i )
  192. {
  193. m_nDETAILTEXTURE = i ? 1 : 0;
  194. #ifdef _DEBUG
  195. m_bDETAILTEXTURE = true;
  196. #endif
  197. }
  198. private:
  199. int m_nDETAIL_BLEND_MODE;
  200. #ifdef _DEBUG
  201. bool m_bDETAIL_BLEND_MODE;
  202. #endif
  203. public:
  204. void SetDETAIL_BLEND_MODE( int i )
  205. {
  206. Assert( i >= 0 && i <= 6 );
  207. m_nDETAIL_BLEND_MODE = i;
  208. #ifdef _DEBUG
  209. m_bDETAIL_BLEND_MODE = true;
  210. #endif
  211. }
  212. void SetDETAIL_BLEND_MODE( bool i )
  213. {
  214. m_nDETAIL_BLEND_MODE = i ? 1 : 0;
  215. #ifdef _DEBUG
  216. m_bDETAIL_BLEND_MODE = true;
  217. #endif
  218. }
  219. private:
  220. int m_nFLASHLIGHTDEPTHFILTERMODE;
  221. #ifdef _DEBUG
  222. bool m_bFLASHLIGHTDEPTHFILTERMODE;
  223. #endif
  224. public:
  225. void SetFLASHLIGHTDEPTHFILTERMODE( int i )
  226. {
  227. Assert( i >= 0 && i <= 2 );
  228. m_nFLASHLIGHTDEPTHFILTERMODE = i;
  229. #ifdef _DEBUG
  230. m_bFLASHLIGHTDEPTHFILTERMODE = true;
  231. #endif
  232. }
  233. void SetFLASHLIGHTDEPTHFILTERMODE( bool i )
  234. {
  235. m_nFLASHLIGHTDEPTHFILTERMODE = i ? 1 : 0;
  236. #ifdef _DEBUG
  237. m_bFLASHLIGHTDEPTHFILTERMODE = true;
  238. #endif
  239. }
  240. private:
  241. int m_nSHADER_SRGB_READ;
  242. #ifdef _DEBUG
  243. bool m_bSHADER_SRGB_READ;
  244. #endif
  245. public:
  246. void SetSHADER_SRGB_READ( int i )
  247. {
  248. Assert( i >= 0 && i <= 0 );
  249. m_nSHADER_SRGB_READ = i;
  250. #ifdef _DEBUG
  251. m_bSHADER_SRGB_READ = true;
  252. #endif
  253. }
  254. void SetSHADER_SRGB_READ( bool i )
  255. {
  256. m_nSHADER_SRGB_READ = i ? 1 : 0;
  257. #ifdef _DEBUG
  258. m_bSHADER_SRGB_READ = true;
  259. #endif
  260. }
  261. private:
  262. int m_nRIMLIGHT;
  263. #ifdef _DEBUG
  264. bool m_bRIMLIGHT;
  265. #endif
  266. public:
  267. void SetRIMLIGHT( int i )
  268. {
  269. Assert( i >= 0 && i <= 1 );
  270. m_nRIMLIGHT = i;
  271. #ifdef _DEBUG
  272. m_bRIMLIGHT = true;
  273. #endif
  274. }
  275. void SetRIMLIGHT( bool i )
  276. {
  277. m_nRIMLIGHT = i ? 1 : 0;
  278. #ifdef _DEBUG
  279. m_bRIMLIGHT = true;
  280. #endif
  281. }
  282. private:
  283. int m_nPHONGWARPTEXTURE;
  284. #ifdef _DEBUG
  285. bool m_bPHONGWARPTEXTURE;
  286. #endif
  287. public:
  288. void SetPHONGWARPTEXTURE( int i )
  289. {
  290. Assert( i >= 0 && i <= 1 );
  291. m_nPHONGWARPTEXTURE = i;
  292. #ifdef _DEBUG
  293. m_bPHONGWARPTEXTURE = true;
  294. #endif
  295. }
  296. void SetPHONGWARPTEXTURE( bool i )
  297. {
  298. m_nPHONGWARPTEXTURE = i ? 1 : 0;
  299. #ifdef _DEBUG
  300. m_bPHONGWARPTEXTURE = true;
  301. #endif
  302. }
  303. private:
  304. int m_nREFRACTFOG;
  305. #ifdef _DEBUG
  306. bool m_bREFRACTFOG;
  307. #endif
  308. public:
  309. void SetREFRACTFOG( int i )
  310. {
  311. Assert( i >= 0 && i <= 1 );
  312. m_nREFRACTFOG = i;
  313. #ifdef _DEBUG
  314. m_bREFRACTFOG = true;
  315. #endif
  316. }
  317. void SetREFRACTFOG( bool i )
  318. {
  319. m_nREFRACTFOG = i ? 1 : 0;
  320. #ifdef _DEBUG
  321. m_bREFRACTFOG = true;
  322. #endif
  323. }
  324. private:
  325. int m_nBASECHROMA;
  326. #ifdef _DEBUG
  327. bool m_bBASECHROMA;
  328. #endif
  329. public:
  330. void SetBASECHROMA( int i )
  331. {
  332. Assert( i >= 0 && i <= 1 );
  333. m_nBASECHROMA = i;
  334. #ifdef _DEBUG
  335. m_bBASECHROMA = true;
  336. #endif
  337. }
  338. void SetBASECHROMA( bool i )
  339. {
  340. m_nBASECHROMA = i ? 1 : 0;
  341. #ifdef _DEBUG
  342. m_bBASECHROMA = true;
  343. #endif
  344. }
  345. private:
  346. int m_nNEBULA;
  347. #ifdef _DEBUG
  348. bool m_bNEBULA;
  349. #endif
  350. public:
  351. void SetNEBULA( int i )
  352. {
  353. Assert( i >= 0 && i <= 1 );
  354. m_nNEBULA = i;
  355. #ifdef _DEBUG
  356. m_bNEBULA = true;
  357. #endif
  358. }
  359. void SetNEBULA( bool i )
  360. {
  361. m_nNEBULA = i ? 1 : 0;
  362. #ifdef _DEBUG
  363. m_bNEBULA = true;
  364. #endif
  365. }
  366. private:
  367. int m_nFLOWMAP;
  368. #ifdef _DEBUG
  369. bool m_bFLOWMAP;
  370. #endif
  371. public:
  372. void SetFLOWMAP( int i )
  373. {
  374. Assert( i >= 0 && i <= 1 );
  375. m_nFLOWMAP = i;
  376. #ifdef _DEBUG
  377. m_bFLOWMAP = true;
  378. #endif
  379. }
  380. void SetFLOWMAP( bool i )
  381. {
  382. m_nFLOWMAP = i ? 1 : 0;
  383. #ifdef _DEBUG
  384. m_bFLOWMAP = true;
  385. #endif
  386. }
  387. private:
  388. int m_nDAMAGED;
  389. #ifdef _DEBUG
  390. bool m_bDAMAGED;
  391. #endif
  392. public:
  393. void SetDAMAGED( int i )
  394. {
  395. Assert( i >= 0 && i <= 1 );
  396. m_nDAMAGED = i;
  397. #ifdef _DEBUG
  398. m_bDAMAGED = true;
  399. #endif
  400. }
  401. void SetDAMAGED( bool i )
  402. {
  403. m_nDAMAGED = i ? 1 : 0;
  404. #ifdef _DEBUG
  405. m_bDAMAGED = true;
  406. #endif
  407. }
  408. private:
  409. int m_nDOPIXELFOG;
  410. #ifdef _DEBUG
  411. bool m_bDOPIXELFOG;
  412. #endif
  413. public:
  414. void SetDOPIXELFOG( int i )
  415. {
  416. Assert( i >= 0 && i <= 1 );
  417. m_nDOPIXELFOG = i;
  418. #ifdef _DEBUG
  419. m_bDOPIXELFOG = true;
  420. #endif
  421. }
  422. void SetDOPIXELFOG( bool i )
  423. {
  424. m_nDOPIXELFOG = i ? 1 : 0;
  425. #ifdef _DEBUG
  426. m_bDOPIXELFOG = true;
  427. #endif
  428. }
  429. private:
  430. int m_nFLOW_DEBUG;
  431. #ifdef _DEBUG
  432. bool m_bFLOW_DEBUG;
  433. #endif
  434. public:
  435. void SetFLOW_DEBUG( int i )
  436. {
  437. Assert( i >= 0 && i <= 2 );
  438. m_nFLOW_DEBUG = i;
  439. #ifdef _DEBUG
  440. m_bFLOW_DEBUG = true;
  441. #endif
  442. }
  443. void SetFLOW_DEBUG( bool i )
  444. {
  445. m_nFLOW_DEBUG = i ? 1 : 0;
  446. #ifdef _DEBUG
  447. m_bFLOW_DEBUG = true;
  448. #endif
  449. }
  450. public:
  451. // CONSTRUCTOR
  452. vertexlit_sob_ps30_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
  453. {
  454. #ifdef _DEBUG
  455. m_bCUBEMAP = false;
  456. #endif // _DEBUG
  457. m_nCUBEMAP = 0;
  458. #ifdef _DEBUG
  459. m_bLIGHTWARPTEXTURE = false;
  460. #endif // _DEBUG
  461. m_nLIGHTWARPTEXTURE = 0;
  462. #ifdef _DEBUG
  463. m_bSELFILLUM = false;
  464. #endif // _DEBUG
  465. m_nSELFILLUM = 0;
  466. #ifdef _DEBUG
  467. m_bSELFILLUMFRESNEL = false;
  468. #endif // _DEBUG
  469. m_nSELFILLUMFRESNEL = 0;
  470. #ifdef _DEBUG
  471. m_bNORMALMAPALPHAENVMAPMASK = false;
  472. #endif // _DEBUG
  473. m_nNORMALMAPALPHAENVMAPMASK = 0;
  474. #ifdef _DEBUG
  475. m_bHALFLAMBERT = false;
  476. #endif // _DEBUG
  477. m_nHALFLAMBERT = 0;
  478. #ifdef _DEBUG
  479. m_bFLASHLIGHT = false;
  480. #endif // _DEBUG
  481. m_nFLASHLIGHT = 0;
  482. #ifdef _DEBUG
  483. m_bDETAILTEXTURE = false;
  484. #endif // _DEBUG
  485. m_nDETAILTEXTURE = 0;
  486. #ifdef _DEBUG
  487. m_bDETAIL_BLEND_MODE = false;
  488. #endif // _DEBUG
  489. m_nDETAIL_BLEND_MODE = 0;
  490. #ifdef _DEBUG
  491. m_bFLASHLIGHTDEPTHFILTERMODE = false;
  492. #endif // _DEBUG
  493. m_nFLASHLIGHTDEPTHFILTERMODE = 0;
  494. #ifdef _DEBUG
  495. m_bSHADER_SRGB_READ = false;
  496. #endif // _DEBUG
  497. m_nSHADER_SRGB_READ = 0;
  498. #ifdef _DEBUG
  499. m_bRIMLIGHT = false;
  500. #endif // _DEBUG
  501. m_nRIMLIGHT = 0;
  502. #ifdef _DEBUG
  503. m_bPHONGWARPTEXTURE = false;
  504. #endif // _DEBUG
  505. m_nPHONGWARPTEXTURE = 0;
  506. #ifdef _DEBUG
  507. m_bREFRACTFOG = false;
  508. #endif // _DEBUG
  509. m_nREFRACTFOG = 0;
  510. #ifdef _DEBUG
  511. m_bBASECHROMA = false;
  512. #endif // _DEBUG
  513. m_nBASECHROMA = 0;
  514. #ifdef _DEBUG
  515. m_bNEBULA = false;
  516. #endif // _DEBUG
  517. m_nNEBULA = 0;
  518. #ifdef _DEBUG
  519. m_bFLOWMAP = false;
  520. #endif // _DEBUG
  521. m_nFLOWMAP = 0;
  522. #ifdef _DEBUG
  523. m_bDAMAGED = false;
  524. #endif // _DEBUG
  525. m_nDAMAGED = 0;
  526. #ifdef _DEBUG
  527. m_bDOPIXELFOG = true;
  528. #endif // _DEBUG
  529. m_nDOPIXELFOG = !IS_FLAG_SET( MATERIAL_VAR_VERTEXFOG ) ? 1 : 0 ;
  530. #ifdef _DEBUG
  531. m_bFLOW_DEBUG = false;
  532. #endif // _DEBUG
  533. m_nFLOW_DEBUG = 0;
  534. }
  535. int GetIndex()
  536. {
  537. // Asserts to make sure that we aren't using any skipped combinations.
  538. // Asserts to make sure that we are setting all of the combination vars.
  539. #ifdef _DEBUG
  540. bool bAllStaticVarsDefined = m_bCUBEMAP && m_bLIGHTWARPTEXTURE && m_bSELFILLUM && m_bSELFILLUMFRESNEL && m_bNORMALMAPALPHAENVMAPMASK && m_bHALFLAMBERT && m_bFLASHLIGHT && m_bDETAILTEXTURE && m_bDETAIL_BLEND_MODE && m_bFLASHLIGHTDEPTHFILTERMODE && m_bSHADER_SRGB_READ && m_bRIMLIGHT && m_bPHONGWARPTEXTURE && m_bREFRACTFOG && m_bBASECHROMA && m_bNEBULA && m_bFLOWMAP && m_bDAMAGED && m_bDOPIXELFOG && m_bFLOW_DEBUG;
  541. Assert( bAllStaticVarsDefined );
  542. #endif // _DEBUG
  543. return ( 40 * m_nCUBEMAP ) + ( 80 * m_nLIGHTWARPTEXTURE ) + ( 160 * m_nSELFILLUM ) + ( 320 * m_nSELFILLUMFRESNEL ) + ( 640 * m_nNORMALMAPALPHAENVMAPMASK ) + ( 1280 * m_nHALFLAMBERT ) + ( 2560 * m_nFLASHLIGHT ) + ( 5120 * m_nDETAILTEXTURE ) + ( 10240 * m_nDETAIL_BLEND_MODE ) + ( 71680 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 215040 * m_nSHADER_SRGB_READ ) + ( 215040 * m_nRIMLIGHT ) + ( 430080 * m_nPHONGWARPTEXTURE ) + ( 860160 * m_nREFRACTFOG ) + ( 1720320 * m_nBASECHROMA ) + ( 3440640 * m_nNEBULA ) + ( 6881280 * m_nFLOWMAP ) + ( 13762560 * m_nDAMAGED ) + ( 27525120 * m_nDOPIXELFOG ) + ( 55050240 * m_nFLOW_DEBUG ) + 0;
  544. }
  545. };
  546. #define shaderStaticTest_vertexlit_sob_ps30 psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_LIGHTWARPTEXTURE + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_SELFILLUMFRESNEL + psh_forgot_to_set_static_NORMALMAPALPHAENVMAPMASK + psh_forgot_to_set_static_HALFLAMBERT + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + psh_forgot_to_set_static_SHADER_SRGB_READ + psh_forgot_to_set_static_RIMLIGHT + psh_forgot_to_set_static_PHONGWARPTEXTURE + psh_forgot_to_set_static_REFRACTFOG + psh_forgot_to_set_static_BASECHROMA + psh_forgot_to_set_static_NEBULA + psh_forgot_to_set_static_FLOWMAP + psh_forgot_to_set_static_DAMAGED + psh_forgot_to_set_static_FLOW_DEBUG + 0
  547. class vertexlit_sob_ps30_Dynamic_Index
  548. {
  549. private:
  550. int m_nNUM_LIGHTS;
  551. #ifdef _DEBUG
  552. bool m_bNUM_LIGHTS;
  553. #endif
  554. public:
  555. void SetNUM_LIGHTS( int i )
  556. {
  557. Assert( i >= 0 && i <= 4 );
  558. m_nNUM_LIGHTS = i;
  559. #ifdef _DEBUG
  560. m_bNUM_LIGHTS = true;
  561. #endif
  562. }
  563. void SetNUM_LIGHTS( bool i )
  564. {
  565. m_nNUM_LIGHTS = i ? 1 : 0;
  566. #ifdef _DEBUG
  567. m_bNUM_LIGHTS = true;
  568. #endif
  569. }
  570. private:
  571. int m_nAMBIENT_LIGHT;
  572. #ifdef _DEBUG
  573. bool m_bAMBIENT_LIGHT;
  574. #endif
  575. public:
  576. void SetAMBIENT_LIGHT( int i )
  577. {
  578. Assert( i >= 0 && i <= 1 );
  579. m_nAMBIENT_LIGHT = i;
  580. #ifdef _DEBUG
  581. m_bAMBIENT_LIGHT = true;
  582. #endif
  583. }
  584. void SetAMBIENT_LIGHT( bool i )
  585. {
  586. m_nAMBIENT_LIGHT = i ? 1 : 0;
  587. #ifdef _DEBUG
  588. m_bAMBIENT_LIGHT = true;
  589. #endif
  590. }
  591. private:
  592. int m_nFLASHLIGHTSHADOWS;
  593. #ifdef _DEBUG
  594. bool m_bFLASHLIGHTSHADOWS;
  595. #endif
  596. public:
  597. void SetFLASHLIGHTSHADOWS( int i )
  598. {
  599. Assert( i >= 0 && i <= 1 );
  600. m_nFLASHLIGHTSHADOWS = i;
  601. #ifdef _DEBUG
  602. m_bFLASHLIGHTSHADOWS = true;
  603. #endif
  604. }
  605. void SetFLASHLIGHTSHADOWS( bool i )
  606. {
  607. m_nFLASHLIGHTSHADOWS = i ? 1 : 0;
  608. #ifdef _DEBUG
  609. m_bFLASHLIGHTSHADOWS = true;
  610. #endif
  611. }
  612. private:
  613. int m_nPIXELFOGTYPE;
  614. #ifdef _DEBUG
  615. bool m_bPIXELFOGTYPE;
  616. #endif
  617. public:
  618. void SetPIXELFOGTYPE( int i )
  619. {
  620. Assert( i >= 0 && i <= 1 );
  621. m_nPIXELFOGTYPE = i;
  622. #ifdef _DEBUG
  623. m_bPIXELFOGTYPE = true;
  624. #endif
  625. }
  626. void SetPIXELFOGTYPE( bool i )
  627. {
  628. m_nPIXELFOGTYPE = i ? 1 : 0;
  629. #ifdef _DEBUG
  630. m_bPIXELFOGTYPE = true;
  631. #endif
  632. }
  633. public:
  634. // CONSTRUCTOR
  635. vertexlit_sob_ps30_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
  636. {
  637. #ifdef _DEBUG
  638. m_bNUM_LIGHTS = false;
  639. #endif // _DEBUG
  640. m_nNUM_LIGHTS = 0;
  641. #ifdef _DEBUG
  642. m_bAMBIENT_LIGHT = false;
  643. #endif // _DEBUG
  644. m_nAMBIENT_LIGHT = 0;
  645. #ifdef _DEBUG
  646. m_bFLASHLIGHTSHADOWS = false;
  647. #endif // _DEBUG
  648. m_nFLASHLIGHTSHADOWS = 0;
  649. #ifdef _DEBUG
  650. m_bPIXELFOGTYPE = true;
  651. #endif // _DEBUG
  652. m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
  653. }
  654. int GetIndex()
  655. {
  656. // Asserts to make sure that we aren't using any skipped combinations.
  657. // Asserts to make sure that we are setting all of the combination vars.
  658. #ifdef _DEBUG
  659. bool bAllDynamicVarsDefined = m_bNUM_LIGHTS && m_bAMBIENT_LIGHT && m_bFLASHLIGHTSHADOWS && m_bPIXELFOGTYPE;
  660. Assert( bAllDynamicVarsDefined );
  661. #endif // _DEBUG
  662. return ( 1 * m_nNUM_LIGHTS ) + ( 5 * m_nAMBIENT_LIGHT ) + ( 10 * m_nFLASHLIGHTSHADOWS ) + ( 20 * m_nPIXELFOGTYPE ) + 0;
  663. }
  664. };
  665. #define shaderDynamicTest_vertexlit_sob_ps30 psh_forgot_to_set_dynamic_NUM_LIGHTS + psh_forgot_to_set_dynamic_AMBIENT_LIGHT + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + 0