Advertisement
Guest User

DD:DA - ENB - FiftyTifty SweetFX shaders

a guest
Jan 13th, 2016
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.25 KB | None | 0 0
  1.  
  2. //++++++++++++++++++++++++++++++++++++++++++++
  3. // ENBSeries effect file
  4. // visit http://enbdev.com for updates
  5. // Copyright (c) 2007-2016 Boris Vorontsov
  6. //++++++++++++++++++++++++++++++++++++++++++++
  7.  
  8. #define APPLYGAMECOLORCORRECTION
  9. #define FIFTYTIFTY_NOSTALGIA_GUI
  10. #define FIFTYTIFTY_VIBRANCE_GUI
  11. #define FIFTYTIFTY_LEVELS_GUI
  12. #define FIFTYTIFTY_TECHNICOLOR_PROD80_GUI
  13. #define FIFTYTIFTY_HPD_TONEMAPPING_GUI
  14. #define FIFTYTIFTY_COLOR_FILMIC_TONEMAPPING_GUI
  15. #define FIFTYTIFTY_CINEONDPX_GUI
  16. #define FIFTYTIFTY_SIMPLE_LINEAR_TONEMAPPING_GUI
  17. #define FIFTYTIFTY_DOS_GUI
  18.  
  19. //post processing mode. Change value (could be 1, 2, 3, 4). Every mode have own internal parameters, look below
  20. #ifndef POSTPROCESS
  21. #define POSTPROCESS 2
  22. #endif
  23.  
  24.  
  25.  
  26. //+++++++++++++++++++++++++++++
  27. //internal parameters, can be modified
  28. //+++++++++++++++++++++++++++++
  29.  
  30. bool bFiftyTiftyNostalgia
  31. <
  32. string UIName = "Nostalgia: Enable";
  33. > = {false};
  34.  
  35. #ifdef FIFTYTIFTY_NOSTALGIA_GUI
  36.  
  37. bool bFiftyTiftyNostalgiaMethod
  38. <
  39. string UIName = "Nostalgia: Use Non-Linear Method?";
  40. > = {false};
  41.  
  42. float3 NBlack
  43. <
  44. string UIName = "Nostalgia: Black";
  45. string UIWidget = "color";
  46. > = {0.0000, 0.0000, 0.0000};
  47.  
  48. float3 NBlue
  49. <
  50. string UIName = "Nostalgia: Blue";
  51. string UIWidget = "color";
  52. > = {0.2431, 0.1922, 0.6353};
  53.  
  54. float3 NDYellowBrown
  55. <
  56. string UIName = "Nostalgia: Dark Yellow-Brown";
  57. string UIWidget = "color";
  58. > = {0.3412, 0.2588, 0.0000};
  59.  
  60. float3 NDRed
  61. <
  62. string UIName = "Nostalgia: Dark Red";
  63. string UIWidget = "color";
  64. float UIStep = 0.0001;
  65. > = {0.5490, 0.2431, 0.2039};
  66.  
  67. float3 NDGrey
  68. <
  69. string UIName = "Nostalgia: Dark Grey";
  70. string UIWidget = "color";
  71. > = {0.3294, 0.2394, 0.3294};
  72.  
  73. float3 NPurple
  74. <
  75. string UIName = "Nostalgia: Purple";
  76. string UIWidget = "color";
  77. float UIStep = 0.0001;
  78. > = {0.5529, 0.2784, 0.7020};
  79.  
  80. float3 NBrown
  81. <
  82. string UIName = "Nostalgia: Brown";
  83. string UIWidget = "color";
  84. > = {0.5647, 0.3725, 0.1451};
  85.  
  86. float3 NLPurple
  87. <
  88. string UIName = "Nostalgia: Light Purple";
  89. string UIWidget = "color";
  90. > = {0.4863, 0.4392, 0.8549};
  91.  
  92. float3 NPGrey
  93. <
  94. string UIName = "Nostalgia: Pale Grey";
  95. string UIWidget = "color";
  96. > = {0.5020, 0.5020, 0.5059};
  97.  
  98. float3 NGreen
  99. <
  100. string UIName = "Nostalgia: Green";
  101. string UIWidget = "color";
  102. > = {0.4078, 0.6627, 0.2549};
  103.  
  104. float3 NPRed
  105. <
  106. string UIName = "Nostalgia: Pale Red";
  107. string UIWidget = "color";
  108. > = {0.7333, 0.4667, 0.4274};
  109.  
  110. float3 NPCyan
  111. <
  112. string UIName = "Nostalgia: Pale Cyan";
  113. string UIWidget = "color";
  114. > = {0.4784, 0.7490, 0.7804};
  115.  
  116. float3 NLGrey
  117. <
  118. string UIName = "Nostalgia: Light Grey";
  119. string UIWidget = "color";
  120. > = {0.6706, 0.6706, 0.6706};
  121.  
  122. float3 NSnotGreen
  123. <
  124. string UIName = "Nostalgia: Snot-Green";
  125. string UIWidget = "color";
  126. > = {0.8157, 0.8627, 0.4431};
  127.  
  128. float3 NLimeGreen
  129. <
  130. string UIName = "Nostalgia: Lime Green";
  131. string UIWidget = "color";
  132. > = {0.6745, 0.9176, 0.5333};
  133.  
  134. float3 NWhite
  135. <
  136. string UIName = "Nostalgia: White";
  137. string UIWidget = "color";
  138. > = {1.0000, 1.0000, 1.0000};
  139. #endif
  140.  
  141. //FiftyTifty Gui Vibrance
  142.  
  143. bool bFiftyTiftyVibrance
  144. <
  145. string UIName = "Vibrance: Enable";
  146. > = {false};
  147.  
  148. #ifdef FIFTYTIFTY_VIBRANCE_GUI
  149. float VibranceIntensity
  150. <
  151. string UIName="Vibrance: Intensity";
  152. string UIWidget="spinner";
  153. float UIMin=0.0000;
  154. float UIMax=1000.0000;
  155. float UIStep=0.01;
  156. > = {1.00};
  157.  
  158. float VibranceR
  159. <
  160. string UIName = "Vibrance: Red Amount";
  161. string UIWidget = "Spinner";
  162. float UIStep=0.01;
  163. > = {1.00};
  164.  
  165. float VibranceRBrightness
  166. <
  167. string UIName = "Vibrance: Red - Brightness";
  168. string UIWidget = "Spinner";
  169. float UIStep=0.01;
  170. > = {1.00};
  171.  
  172. float VibranceG
  173. <
  174. string UIName = "Vibrance: Green Amount";
  175. string UIWidget = "Spinner";
  176. float UIStep=0.01;
  177. > = {1.00};
  178.  
  179. float VibranceGBrightness
  180. <
  181. string UIName = "Vibrance: Green - Brightness";
  182. string UIWidget = "Spinner";
  183. float UIStep=0.01;
  184. > = {1.00};
  185.  
  186. float VibranceB
  187. <
  188. string UIName = "Vibrance: Blue Amount";
  189. string UIWidget = "Spinner";
  190. float UIStep=0.01;
  191. > = {1.00};
  192.  
  193. float VibranceBBrightness
  194. <
  195. string UIName = "Vibrance: Blue - Brightness";
  196. string UIWidget = "Spinner";
  197. float UIStep=0.01;
  198. > = {1.00};
  199. #endif
  200.  
  201. //FiftyTifty GUI Levels
  202.  
  203. bool bFiftyTiftyLevels
  204. <
  205. string UIName = "Levels: Enable";
  206. > = {false};
  207.  
  208. #ifdef FIFTYTIFTY_LEVELS_GUI
  209.  
  210. float LevelsBlackPoint
  211. <
  212. string UIName="Levels: Black Point";
  213. string UIWidget="spinner";
  214. float UIMin=0.0001;
  215. float UIMax=1.0000;
  216. float UIStep=0.0001;
  217. > = {0.0001};
  218.  
  219. float LevelsWhitePoint
  220. <
  221. string UIName="Levels: White Point";
  222. string UIWidget="spinner";
  223. float UIMin=0.0001;
  224. float UIMax=1.00;
  225. float UIStep=0.0001;
  226. > = {1.0000};
  227. #endif
  228.  
  229. //FiftyTifty GUI CineonDPX
  230.  
  231. bool bFiftyTiftyDPX
  232. <
  233. string UIName = "CineonDPX: Enable";
  234. > = {false};
  235.  
  236. #ifdef FIFTYTIFTY_CINEONDPX_GUI
  237.  
  238. float DPXRed
  239. <
  240. string UIName="CineonDPX: Red";
  241. string UIWidget="spinner";
  242. float UIMin=0.01;
  243. float UIMax=100.00;
  244. float UIStep=0.01;
  245. > = {8.00};
  246.  
  247. float DPXGreen
  248. <
  249. string UIName="CineonDPX: Green";
  250. string UIWidget="spinner";
  251. float UIMin=0.01;
  252. float UIMax=100.00;
  253. float UIStep=0.01;
  254. > = {8.00};
  255.  
  256. float DPXBlue
  257. <
  258. string UIName="CineonDPX: Blue";
  259. string UIWidget="spinner";
  260. float UIMin=0.01;
  261. float UIMax=100.00;
  262. float UIStep=0.01;
  263. > = {8.00};
  264.  
  265. float DPXColorGamma
  266. <
  267. string UIName="CineonDPX: Color Gamma";
  268. string UIWidget="spinner";
  269. float UIMin=0.01;
  270. float UIMax=100.00;
  271. float UIStep=0.01;
  272. > = {2.50};
  273.  
  274. float DPXSaturation
  275. <
  276. string UIName="CineonDPX: Saturation";
  277. string UIWidget="spinner";
  278. float UIMin=0.01;
  279. float UIMax=100.00;
  280. float UIStep=0.01;
  281. > = {2.30};
  282.  
  283. float DPXRedC
  284. <
  285. string UIName="CineonDPX: RedC";
  286. string UIWidget="spinner";
  287. float UIMin=0.01;
  288. float UIMax=100.00;
  289. float UIStep=0.01;
  290. > = {0.36};
  291.  
  292. float DPXGreenC
  293. <
  294. string UIName="CineonDPX: GreenC";
  295. string UIWidget="spinner";
  296. float UIMin=0.01;
  297. float UIMax=100.00;
  298. float UIStep=0.01;
  299. > = {0.36};
  300.  
  301. float DPXBlueC
  302. <
  303. string UIName="CineonDPX: BlueC";
  304. string UIWidget="spinner";
  305. float UIMin=0.01;
  306. float UIMax=100.00;
  307. float UIStep=0.01;
  308. > = {0.36};
  309.  
  310. float DPXAmount
  311. <
  312. string UIName="CineonDPX: Amount";
  313. string UIWidget="spinner";
  314. float UIMin=0.001;
  315. float UIMax=1.000;
  316. float UIStep=0.001;
  317. > = {0.700};
  318.  
  319. #endif
  320.  
  321. //FiftyTifty GUI Technicolor Prod80
  322.  
  323. bool bFiftyTiftyTechnicolorProd80
  324. <
  325. string UIName = "Technicolor - Prod80: Enable";
  326. > = {false};
  327.  
  328. #ifdef FIFTYTIFTY_TECHNICOLOR_PROD80_GUI
  329.  
  330. float TechnicolorProd80ColorStrengthR
  331. <
  332. string UIName="Technicolor - Prod80: Red Strength";
  333. string UIWidget="spinner";
  334. float UIMin=0.01;
  335. float UIMax=100.00;
  336. float UIStep=0.01;
  337. > = {0.20};
  338.  
  339. float TechnicolorProd80ColorStrengthG
  340. <
  341. string UIName="Technicolor - Prod80: Green Strength";
  342. string UIWidget="spinner";
  343. float UIMin=0.01;
  344. float UIMax=100.00;
  345. float UIStep=0.01;
  346. > = {0.200};
  347.  
  348. float TechnicolorProd80ColorStrengthB
  349. <
  350. string UIName="Technicolor - Prod80: Blue Strength";
  351. string UIWidget="spinner";
  352. float UIMin=0.01;
  353. float UIMax=100.00;
  354. float UIStep=0.01;
  355. > = {0.20};
  356.  
  357. float TechnicolorProd80Brightness
  358. <
  359. string UIName="Technicolor - Prod80: Brightness";
  360. string UIWidget="spinner";
  361. float UIMin=0.01;
  362. float UIMax=100.00;
  363. float UIStep=0.01;
  364. > = {1.00};
  365.  
  366. float TechnicolorProd80Strength
  367. <
  368. string UIName="Technicolor - Prod80: Strength";
  369. string UIWidget="spinner";
  370. float UIMin=0.01;
  371. float UIMax=100.00;
  372. float UIStep=0.01;
  373. > = {1.00};
  374.  
  375. float TechnicolorProd80Saturation
  376. <
  377. string UIName="Technicolor - Prod80: Saturation";
  378. string UIWidget="spinner";
  379. float UIMin=0.01;
  380. float UIMax=100.00;
  381. float UIStep=0.01;
  382. > = {0.70};
  383. #endif
  384.  
  385. //FiftyTifty Simple Linear Tonemapping
  386. bool bFiftyTiftySimpleLinearTonemapping
  387. <
  388. string UIName = "Simple Tonemapping: Enable";
  389. > = {false};
  390.  
  391. #ifdef FIFTYTIFTY_SIMPLE_LINEAR_TONEMAPPING_GUI
  392. float FiftyTiftySLTonemappingExposure
  393. <
  394. string UIName="SL Tonemapping: Exposure.";
  395. string UIWidget="spinner";
  396. float UIMin=0.00;
  397. float UIMax=100.00;
  398. float UIStep=0.01;
  399. > = {16.00};
  400. #endif
  401.  
  402. //FiftyTifty GUI HPD Tonemapping
  403. bool bFiftyTiftyHPDTonemapping
  404. <
  405. string UIName = "HPD Tonemapping: Enable";
  406. > = {false};
  407.  
  408. #ifdef FIFTYTIFTY_HPD_TONEMAPPING_GUI
  409. bool bFiftyTiftyHPDTonemappingMethod
  410. <
  411. string UIName = "HPD Tonemapping: Use 2nd Method?";
  412. > = {false};
  413.  
  414. float HPDTonemappingExposure
  415. <
  416. string UIName="HPD Tonemapping: Exposure.";
  417. string UIWidget="spinner";
  418. float UIMin=0.00;
  419. float UIMax=1000.00;
  420. float UIStep=0.01;
  421. > = {2.2f};
  422.  
  423. float HPDTonemappingClipping
  424. <
  425. string UIName="HPD Tonemapping: Clipping";
  426. string UIWidget="spinner";
  427. float UIMin=0.0;
  428. float UIMax=1000.0;
  429. float UIStep=0.0001;
  430. > = {0.004f};
  431.  
  432. float HPDTonemappingUpperTone
  433. <
  434. string UIName="HPD Tonemapping: Upper Tone";
  435. string UIWidget="spinner";
  436. float UIMin=0.01;
  437. float UIMax=100.00;
  438. float UIStep=0.01;
  439. > = {6.2f};
  440.  
  441. float HPDTonemappingGreyTone
  442. <
  443. string UIName="HPD Tonemapping: Grey Tone";
  444. string UIWidget="spinner";
  445. float UIMin=0.01;
  446. float UIMax=100.00;
  447. float UIStep=0.01;
  448. > = {0.5f};
  449.  
  450. float HPDTonemappingMiddleTone
  451. <
  452. string UIName="HPD Tonemapping: Middle Tone";
  453. string UIWidget="spinner";
  454. float UIMin=0.01;
  455. float UIMax=100.00;
  456. float UIStep=0.01;
  457. > = {1.7f};
  458.  
  459. float HPDTonemappingLowerTone
  460. <
  461. string UIName="HPD Tonemapping: Lower Tone";
  462. string UIWidget="spinner";
  463. float UIMin=0.01;
  464. float UIMax=100.00;
  465. float UIStep=0.01;
  466. > = {0.06};
  467.  
  468. float HPDTonemappingLerp // 1.0 = None, 0.001 = Practically entire effect
  469. <
  470. string UIName="HPD Tonemapping: Amount";
  471. string UIWidget="spinner";
  472. float UIMin=0.0001;
  473. float UIMax=1.0000;
  474. float UIStep=0.0001;
  475. > = {0.0001};
  476. #endif
  477.  
  478. bool bFiftyTiftyColorFilmicTonemapping
  479. <
  480. string UIName = "Color Filmic Tonemapping: Enable";
  481. > = {false};
  482.  
  483. #ifdef FIFTYTIFTY_COLOR_FILMIC_TONEMAPPING_GUI
  484. float CFLinearColorMultiplier
  485. <
  486. string UIName="Color Filmic Tonemapping: Linear Color.";
  487. string UIWidget="spinner";
  488. float UIMin=0.00;
  489. float UIMax=100.00;
  490. float UIStep=0.01;
  491. > = {1.25};
  492.  
  493. float CFTonemappingPower
  494. <
  495. string UIName="Color Filmic Tonemapping: Power.";
  496. string UIWidget="spinner";
  497. float UIMin=0.00;
  498. float UIMax=100.00;
  499. float UIStep=0.01;
  500. > = {1.25};
  501. #endif
  502.  
  503.  
  504. //modify these values to tweak various color processing
  505. //POSTPROCESS 1
  506. float EAdaptationMinV1=0.01;
  507. float EAdaptationMaxV1=0.07;
  508. float EContrastV1=0.95;
  509. float EColorSaturationV1=1.0;
  510. float EToneMappingCurveV1=6.0;
  511.  
  512. //POSTPROCESS 2
  513. //float EBrightnessV2=2.5;
  514. float EAdaptationMinV2=0.05;
  515. float EAdaptationMaxV2=0.05;//0.125;
  516. float EToneMappingCurveV2=8.0;
  517. float EIntensityContrastV2=1.2;
  518. float EColorSaturationV2=1.0;
  519. float EToneMappingOversaturationV2=100.0;
  520.  
  521. //POSTPROCESS 3
  522. float EAdaptationMinV3=0.05;
  523. float EAdaptationMaxV3=0.125;
  524. float EToneMappingCurveV3=4.0;
  525. float EToneMappingOversaturationV3=60.0;
  526.  
  527. //POSTPROCESS 4
  528. float EAdaptationMinV4=0.2;
  529. float EAdaptationMaxV4=0.125;
  530. float EBrightnessCurveV4=0.7;
  531. float EBrightnessMultiplierV4=0.45;
  532. float EBrightnessToneMappingCurveV4=0.5;
  533.  
  534.  
  535.  
  536. //parameters for ldr color correction, if enabled
  537. float ECCGamma
  538. <
  539. string UIName="CC: Gamma";
  540. string UIWidget="Spinner";
  541. float UIMin=0.2;//not zero!!!
  542. float UIMax=5.0;
  543. > = {1.0};
  544.  
  545. float ECCInBlack
  546. <
  547. string UIName="CC: In black";
  548. string UIWidget="Spinner";
  549. float UIMin=0.0;
  550. float UIMax=1.0;
  551. > = {0.0};
  552.  
  553. float ECCInWhite
  554. <
  555. string UIName="CC: In white";
  556. string UIWidget="Spinner";
  557. float UIMin=0.0;
  558. float UIMax=1.0;
  559. > = {1.0};
  560.  
  561. float ECCOutBlack
  562. <
  563. string UIName="CC: Out black";
  564. string UIWidget="Spinner";
  565. float UIMin=0.0;
  566. float UIMax=1.0;
  567. > = {0.0};
  568.  
  569. float ECCOutWhite
  570. <
  571. string UIName="CC: Out white";
  572. string UIWidget="Spinner";
  573. float UIMin=0.0;
  574. float UIMax=1.0;
  575. > = {1.0};
  576.  
  577. float ECCBrightness
  578. <
  579. string UIName="CC: Brightness";
  580. string UIWidget="Spinner";
  581. float UIMin=0.0;
  582. float UIMax=10.0;
  583. > = {1.0};
  584.  
  585. float ECCContrastGrayLevel
  586. <
  587. string UIName="CC: Contrast gray level";
  588. string UIWidget="Spinner";
  589. float UIMin=0.01;
  590. float UIMax=0.99;
  591. > = {0.5};
  592.  
  593. float ECCContrast
  594. <
  595. string UIName="CC: Contrast";
  596. string UIWidget="Spinner";
  597. float UIMin=0.0;
  598. float UIMax=10.0;
  599. > = {1.0};
  600.  
  601. float ECCSaturation
  602. <
  603. string UIName="CC: Saturation";
  604. string UIWidget="Spinner";
  605. float UIMin=0.0;
  606. float UIMax=10.0;
  607. > = {1.0};
  608.  
  609. float ECCDesaturateShadows
  610. <
  611. string UIName="CC: Desaturate shadows";
  612. string UIWidget="Spinner";
  613. float UIMin=0.0;
  614. float UIMax=1.0;
  615. > = {0.0};
  616.  
  617. float3 ECCColorBalanceShadows <
  618. string UIName="CC: Color balance shadows";
  619. string UIWidget="Color";
  620. > = {0.5, 0.5, 0.5};
  621.  
  622. float3 ECCColorBalanceHighlights <
  623. string UIName="CC: Color balance highlights";
  624. string UIWidget="Color";
  625. > = {0.5, 0.5, 0.5};
  626.  
  627. float3 ECCChannelMixerR <
  628. string UIName="CC: Channel mixer R";
  629. string UIWidget="Color";
  630. > = {1.0, 0.0, 0.0};
  631.  
  632. float3 ECCChannelMixerG <
  633. string UIName="CC: Channel mixer G";
  634. string UIWidget="Color";
  635. > = {0.0, 1.0, 0.0};
  636.  
  637. float3 ECCChannelMixerB <
  638. string UIName="CC: Channel mixer B";
  639. string UIWidget="Color";
  640. > = {0.0, 0.0, 1.0};
  641.  
  642.  
  643.  
  644. //+++++++++++++++++++++++++++++
  645. //external parameters, do not modify
  646. //+++++++++++++++++++++++++++++
  647. //keyboard controlled temporary variables (in some versions exists in the config file). Press and hold key 1,2,3...8 together with PageUp or PageDown to modify. By default all set to 1.0
  648. float4 tempF1; //0,1,2,3
  649. float4 tempF2; //5,6,7,8
  650. float4 tempF3; //9,0
  651. //x=generic timer in range 0..1, period of 16777216 ms (4.6 hours), w=frame time elapsed (in seconds)
  652. float4 Timer;
  653. //x=Width, y=1/Width, z=ScreenScaleY, w=1/ScreenScaleY
  654. float4 ScreenSize;
  655. //changes in range 0..1, 0 means that night time, 1 - day time
  656. //float ENightDayFactor;
  657. //changes 0 or 1. 0 means that exterior, 1 - interior
  658. //float EInteriorFactor;
  659. //changes in range 0..1, 0 means full quality, 1 lowest dynamic quality (0.33, 0.66 are limits for quality levels)
  660. //float EAdaptiveQualityFactor;
  661. //.x - current weather index, .y - outgoing weather index, .z - weather transition, .w - time of the day in 24 standart hours. Weather index is value from _weatherlist.ini, for example WEATHER002 means index==2, but index==0 means that weather not captured.
  662. //float4 WeatherAndTime;
  663. //enb version of bloom applied, ignored if original post processing used
  664. float EBloomAmount;
  665. //fov in degrees
  666. //float FieldOfView;
  667.  
  668.  
  669.  
  670. texture2D texs0;//color
  671. texture2D texs3;//bloom enb
  672. texture2D texs4;//adaptation enb
  673. texture2D texs7;//palette enb
  674.  
  675. sampler2D _s0 = sampler_state
  676. {
  677. Texture = <texs0>;
  678. MinFilter = POINT;//
  679. MagFilter = POINT;//
  680. MipFilter = NONE;//LINEAR;
  681. AddressU = Clamp;
  682. AddressV = Clamp;
  683. SRGBTexture=FALSE;
  684. MaxMipLevel=0;
  685. MipMapLodBias=0;
  686. };
  687.  
  688. sampler2D _s3 = sampler_state
  689. {
  690. Texture = <texs3>;
  691. MinFilter = LINEAR;//
  692. MagFilter = LINEAR;//
  693. MipFilter = NONE;//LINEAR;
  694. AddressU = Clamp;
  695. AddressV = Clamp;
  696. SRGBTexture=FALSE;
  697. MaxMipLevel=0;
  698. MipMapLodBias=0;
  699. };
  700.  
  701. sampler2D _s4 = sampler_state
  702. {
  703. Texture = <texs4>;
  704. MinFilter = LINEAR;//
  705. MagFilter = LINEAR;//
  706. MipFilter = NONE;//LINEAR;
  707. AddressU = Clamp;
  708. AddressV = Clamp;
  709. SRGBTexture=FALSE;
  710. MaxMipLevel=0;
  711. MipMapLodBias=0;
  712. };
  713.  
  714. sampler2D _s7 = sampler_state
  715. {
  716. Texture = <texs7>;
  717. MinFilter = LINEAR;
  718. MagFilter = LINEAR;
  719. MipFilter = NONE;
  720. AddressU = Clamp;
  721. AddressV = Clamp;
  722. SRGBTexture=FALSE;
  723. MaxMipLevel=0;
  724. MipMapLodBias=0;
  725. };
  726.  
  727. struct VS_OUTPUT_POST
  728. {
  729. float4 vpos : POSITION;
  730. float2 txcoord0 : TEXCOORD0;
  731. };
  732. struct VS_INPUT_POST
  733. {
  734. float3 pos : POSITION;
  735. float2 txcoord0 : TEXCOORD0;
  736. };
  737.  
  738.  
  739.  
  740. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  741. //
  742. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  743. VS_OUTPUT_POST VS_Quad(VS_INPUT_POST IN)
  744. {
  745. VS_OUTPUT_POST OUT;
  746.  
  747. OUT.vpos=float4(IN.pos.x,IN.pos.y,IN.pos.z,1.0);
  748.  
  749. OUT.txcoord0.xy=IN.txcoord0.xy;
  750.  
  751. return OUT;
  752. }
  753.  
  754.  
  755.  
  756. float4 PS_Draw(VS_OUTPUT_POST IN, float2 vPos : VPOS) : COLOR
  757. {
  758. float4 _oC0=0.0; //output
  759.  
  760. float4 _c6=float4(0, 0, 0, 0);
  761. float4 _c7=float4(0.212500006, 0.715399981, 0.0720999986, 1.0);
  762.  
  763. float4 r0;
  764. float4 r1;
  765. float4 r2;
  766. float4 r3;
  767. float4 r4;
  768. float4 r5;
  769. float4 r6;
  770. float4 r7;
  771. float4 r8;
  772. float4 r9;
  773. float4 r10;
  774. float4 r11;
  775.  
  776.  
  777. float4 _v0=0.0;
  778.  
  779. _v0.xy=IN.txcoord0.xy;
  780. r1=tex2D(_s0, _v0.xy); //color
  781.  
  782. //apply bloom
  783. float4 xcolorbloom=tex2D(_s3, _v0.xy);
  784.  
  785. xcolorbloom.xyz=xcolorbloom-r1;
  786. xcolorbloom.xyz=max(xcolorbloom, 0.0);
  787. r1.xyz+=xcolorbloom*EBloomAmount;
  788.  
  789. r11=r1; //my bypass
  790. _oC0.xyz=r1.xyz; //for future use without game color corrections
  791.  
  792.  
  793. float4 color=_oC0;
  794.  
  795.  
  796. //adaptation in time
  797. float4 Adaptation=tex2D(_s4, 0.5);
  798. float grayadaptation=max(max(Adaptation.x, Adaptation.y), Adaptation.z);
  799.  
  800. #if (POSTPROCESS==1)
  801.  
  802. grayadaptation=max(grayadaptation, 0.0);
  803. grayadaptation=min(grayadaptation, 50.0);
  804. color.xyz=color.xyz/(grayadaptation*EAdaptationMaxV1+EAdaptationMinV1);//*tempF1.x
  805.  
  806. float cgray=dot(color.xyz, float3(0.27, 0.67, 0.06));
  807. cgray=pow(cgray, EContrastV1);
  808. float3 poweredcolor=pow(color.xyz, EColorSaturationV1);
  809. float newgray=dot(poweredcolor.xyz, float3(0.27, 0.67, 0.06));
  810. color.xyz=poweredcolor.xyz*cgray/(newgray+0.0001);
  811.  
  812. float3 luma=color.xyz;
  813. float lumamax=300.0;
  814. color.xyz=(color.xyz * (1.0 + color.xyz/lumamax))/(color.xyz + EToneMappingCurveV1);
  815.  
  816. #endif
  817.  
  818.  
  819.  
  820. #if (POSTPROCESS==2)
  821.  
  822. grayadaptation=max(grayadaptation, 0.0);
  823. grayadaptation=min(grayadaptation, 50.0);
  824. color.xyz=color.xyz/(grayadaptation*EAdaptationMaxV2+EAdaptationMinV2);//*tempF1.x
  825.  
  826. //color.xyz*=EBrightnessV2;
  827. color.xyz+=0.000001;
  828. float3 xncol=normalize(color.xyz);
  829. float3 scl=color.xyz/xncol.xyz;
  830. scl=pow(scl, EIntensityContrastV2);
  831. xncol.xyz=pow(xncol.xyz, EColorSaturationV2);
  832. color.xyz=scl*xncol.xyz;
  833.  
  834. float lumamax=EToneMappingOversaturationV2;
  835. color.xyz=(color.xyz * (1.0 + color.xyz/lumamax))/(color.xyz + EToneMappingCurveV2);
  836.  
  837. #endif
  838.  
  839.  
  840. #if (POSTPROCESS==3)
  841.  
  842. grayadaptation=max(grayadaptation, 0.0);
  843. grayadaptation=min(grayadaptation, 50.0);
  844. color.xyz=color.xyz/(grayadaptation*EAdaptationMaxV3+EAdaptationMinV3);//*tempF1.x
  845.  
  846. float lumamax=EToneMappingOversaturationV3;
  847. color.xyz=(color.xyz * (1.0 + color.xyz/lumamax))/(color.xyz + EToneMappingCurveV3);
  848.  
  849. #endif
  850.  
  851. //color.xyz=tex2D(_s0, _v0.xy) + xcolorbloom.xyz*float3(0.7, 0.6, 1.0)*0.5;
  852. //color.xyz=tex2D(_s0, _v0.xy) + xcolorbloom.xyz*float3(0.7, 0.6, 1.0)*0.5;
  853. //color.xyz*=0.7;
  854.  
  855.  
  856. #if (POSTPROCESS==4)
  857.  
  858. grayadaptation=max(grayadaptation, 0.0);
  859. grayadaptation=min(grayadaptation, 50.0);
  860. color.xyz=color.xyz/(grayadaptation*EAdaptationMaxV4+EAdaptationMinV4);
  861.  
  862. float Y = dot(color.xyz, float3(0.299, 0.587, 0.114)); //0.299 * R + 0.587 * G + 0.114 * B;
  863. float U = dot(color.xyz, float3(-0.14713, -0.28886, 0.436)); //-0.14713 * R - 0.28886 * G + 0.436 * B;
  864. float V = dot(color.xyz, float3(0.615, -0.51499, -0.10001)); //0.615 * R - 0.51499 * G - 0.10001 * B;
  865. Y=pow(Y, EBrightnessCurveV4);
  866. Y=Y*EBrightnessMultiplierV4;
  867. // Y=Y/(Y+EBrightnessToneMappingCurveV4);
  868. // float desaturatefact=saturate(Y*Y*Y*1.7);
  869. // U=lerp(U, 0.0, desaturatefact);
  870. // V=lerp(V, 0.0, desaturatefact);
  871. color.xyz=V * float3(1.13983, -0.58060, 0.0) + U * float3(0.0, -0.39465, 2.03211) + Y;
  872.  
  873. color.xyz=max(color.xyz, 0.0);
  874. color.xyz=color.xyz/(color.xyz+EBrightnessToneMappingCurveV4);
  875.  
  876. #endif
  877.  
  878.  
  879.  
  880. //pallete texture (0.082+ version feature)
  881. #ifdef E_CC_PALETTE
  882. color.rgb=saturate(color.rgb);
  883. float3 brightness=Adaptation.xyz;//tex2D(_s4, 0.5);//adaptation luminance
  884. // brightness=saturate(brightness);//old version from ldr games
  885. brightness=(brightness/(brightness+1.0));//new version
  886. brightness=max(brightness.x, max(brightness.y, brightness.z));//new version
  887. float3 palette;
  888. float4 uvsrc=0.0;
  889. uvsrc.y=brightness.r;
  890. uvsrc.x=color.r;
  891. palette.r=tex2Dlod(_s7, uvsrc).r;
  892. uvsrc.x=color.g;
  893. uvsrc.y=brightness.g;
  894. palette.g=tex2Dlod(_s7, uvsrc).g;
  895. uvsrc.x=color.b;
  896. uvsrc.y=brightness.b;
  897. palette.b=tex2Dlod(_s7, uvsrc).b;
  898. color.rgb=palette.rgb;
  899. #endif //E_CC_PALETTE
  900.  
  901.  
  902.  
  903. #ifdef E_CC_PROCEDURAL
  904. float tempgray;
  905. float4 tempvar;
  906. float3 tempcolor;
  907. /*
  908. //these replaced by "levels"
  909. //+++ gamma
  910. if (ECCGamma!=1.0)
  911. color=pow(color, 1.0/ECCGamma);
  912.  
  913. //+++ brightness like in photoshop
  914. color=color+ECCAditiveBrightness;
  915.  
  916. //+++ lightness
  917. tempvar.x=saturate(ELightness);
  918. tempvar.y=saturate(1.0+ECCLightness);
  919. color=tempvar.x*(1.0-color) + (tempvar.y*color);
  920. */
  921. //+++ levels like in photoshop, including gamma, lightness, additive brightness
  922. color=max(color-ECCInBlack, 0.0) / max(ECCInWhite-ECCInBlack, 0.0001);
  923. if (ECCGamma!=1.0) color=pow(color, ECCGamma);
  924. color=color*(ECCOutWhite-ECCOutBlack) + ECCOutBlack;
  925.  
  926. //+++ brightness
  927. color=color*ECCBrightness;
  928.  
  929. //+++ contrast
  930. color=(color-ECCContrastGrayLevel) * ECCContrast + ECCContrastGrayLevel;
  931.  
  932. //+++ saturation
  933. tempgray=dot(color, 0.3333);
  934. color=lerp(tempgray, color, ECCSaturation);
  935.  
  936. //+++ desaturate shadows
  937. tempgray=dot(color, 0.3333);
  938. tempvar.x=saturate(1.0-tempgray);
  939. tempvar.x*=tempvar.x;
  940. tempvar.x*=tempvar.x;
  941. color=lerp(color, tempgray, ECCDesaturateShadows*tempvar.x);
  942.  
  943. //+++ color balance
  944. color=saturate(color);
  945. tempgray=dot(color, 0.3333);
  946. float2 shadow_highlight=float2(1.0-tempgray, tempgray);
  947. shadow_highlight*=shadow_highlight;
  948. color.rgb+=(ECCColorBalanceHighlights*2.0-1.0)*color * shadow_highlight.x;
  949. color.rgb+=(ECCColorBalanceShadows*2.0-1.0)*(1.0-color) * shadow_highlight.y;
  950.  
  951. //+++ channel mixer
  952. tempcolor=color;
  953. color.r=dot(tempcolor, ECCChannelMixerR);
  954. color.g=dot(tempcolor, ECCChannelMixerG);
  955. color.b=dot(tempcolor, ECCChannelMixerB);
  956. #endif //E_CC_PROCEDURAL
  957.  
  958. //Begin FiftyTifty Levels
  959. if(bFiftyTiftyLevels)
  960. {
  961. float WhitePointFloat = (LevelsWhitePoint - LevelsBlackPoint);
  962. float BlackPointFloat = (LevelsBlackPoint);
  963.  
  964. color.rgb = color.rgb * WhitePointFloat - (BlackPointFloat * WhitePointFloat);
  965. }
  966. //End FiftyTifty Levels
  967.  
  968.  
  969. //Begin FiftyTifty Nostalgia - Thing looks awful, probably didn't get it to work right. Only shows black, NDYellowBrown and white.
  970. if(bFiftyTiftyNostalgia)
  971. {
  972. float3 NColor = color.rgb;
  973.  
  974. float3 NPalette[16];
  975. NPalette[0] = NBlack; //Black
  976. NPalette[1] = NBlue; //Blue
  977. NPalette[2] = NDYellowBrown; //Dark Yellow-Brown
  978. NPalette[3] = NDRed; //Dark Red
  979. NPalette[4] = NDGrey; //Dark Grey
  980. NPalette[5] = NPurple; //Purple
  981. NPalette[6] = NBrown; //Brown
  982. NPalette[7] = NLPurple; //Light Purple
  983. NPalette[8] = NPGrey; //Pale Grey
  984. NPalette[9] = NGreen; //Green
  985. NPalette[10] = NPRed; //Pale Red
  986. NPalette[11] = NPCyan; //Pale Cyan
  987. NPalette[12] = NLGrey; //Light Grey
  988. NPalette[13] = NSnotGreen; //Snot-Green
  989. NPalette[14] = NLimeGreen; //Lime-Green
  990. NPalette[15] = NWhite; //White
  991.  
  992.  
  993. float3 NDiff = NColor;
  994. float NDist = dot(NDiff,NDiff);
  995. float NClosestDist = NDist;
  996. float3 NClosestColor = float3(0.0000,0.0000,0.0000);
  997. int Nint = 1;
  998.  
  999. for (Nint = 1 ; Nint <= 15 ; Nint++)
  1000. {
  1001. NDiff = NColor - NPalette[Nint]; //difference
  1002. NClosestDist = dot(NDiff,NDiff); //squared distance
  1003.  
  1004. if (NDist < NClosestDist) //ternary would also work here
  1005. {
  1006. NClosestDist = NDist;
  1007. NClosestColor = NPalette[Nint];
  1008. }
  1009. }
  1010.  
  1011. if(bFiftyTiftyNostalgiaMethod)
  1012. {
  1013. color.xyz = NClosestColor.rgb;
  1014. color.xyz = pow(color.xyz, 1.0/2.2);
  1015. }
  1016. else
  1017. {
  1018. color.xyz = NClosestColor.rgb;
  1019. }
  1020. }
  1021. //End FiftyTifty Nostalgia
  1022.  
  1023.  
  1024. //Begin FiftyTifty DPX
  1025. if(bFiftyTiftyDPX)
  1026. {
  1027. static const float3x3 DPXRGB = float3x3
  1028. (
  1029. 2.67147117265996,-1.26723605786241,-0.410995602172227,
  1030. -1.02510702934664,1.98409116241089,0.0439502493584124,
  1031. 0.0610009456429445,-0.223670750812863,1.15902104167061
  1032. );
  1033.  
  1034. static const float3x3 DPXXYZ = float3x3
  1035. (
  1036. 0.500303383543316,0.338097573222739,0.164589779545857,
  1037. 0.257968894274758,0.676195259144706,0.0658358459823868,
  1038. 0.0234517888692628,0.1126992737203,0.866839673124201
  1039. );
  1040.  
  1041. float DPXContrast = 0.1;
  1042. float DPXGamma = 1.0;
  1043.  
  1044. float3 RGB_Curve = float3(DPXRed,DPXGreen,DPXBlue);
  1045. float3 RGB_C = float3(DPXRedC,DPXGreenC,DPXBlueC);
  1046.  
  1047. float3 DPXColor = color.rgb;
  1048.  
  1049. DPXColor = pow(abs(DPXColor), 1.0/DPXGamma);
  1050. DPXColor = DPXColor * (1.0 - DPXContrast) + (0.5 * DPXContrast);
  1051.  
  1052. float3 Btemp = (1.0 / (1.0 + exp(RGB_Curve / 2.0)));
  1053. DPXColor = ((1.0 / (1.0 + exp(-RGB_Curve * (DPXColor - RGB_C)))) / (-2.0 * Btemp + 1.0)) + (-Btemp / (-2.0 * Btemp + 1.0));
  1054.  
  1055. //RGB to HSV, replace the code k?
  1056. float value = max(max(DPXColor.r, DPXColor.g), DPXColor.b);
  1057. float3 DPXColorFinal = DPXColor / value;
  1058.  
  1059. DPXColorFinal = pow(abs(DPXColorFinal), 1.0/DPXColorGamma);
  1060. float3 c0 = DPXColorFinal * value;
  1061. c0 = mul(DPXXYZ, c0);
  1062.  
  1063. float DPXLuma = dot(c0, float3(0.30, 0.59, 0.11));
  1064.  
  1065. c0 = (1.0 - DPXSaturation) * DPXLuma + DPXSaturation * c0;
  1066. c0 = mul(DPXRGB, c0);
  1067.  
  1068. color.rgb = lerp(color.rgb, c0, DPXAmount);
  1069. }
  1070. //End FiftyTifty DPX
  1071.  
  1072.  
  1073. //Begin FiftyTifty Technicolor Prod80
  1074. if(bFiftyTiftyTechnicolorProd80)
  1075. {
  1076. float3 colStrength = float3(TechnicolorProd80ColorStrengthR,TechnicolorProd80ColorStrengthG,TechnicolorProd80ColorStrengthB);
  1077. float3 tsource = saturate(color.rgb);
  1078. float3 ttemp = 1 - tsource;
  1079. float3 ttarget = ttemp.grg;
  1080. float3 ttarget2 = ttemp.bbr;
  1081. float3 ttemp2 = tsource.rgb * ttarget.rgb;
  1082. ttemp2.rgb *= ttarget2.rgb;
  1083.  
  1084. ttemp.rgb = ttemp2.rgb * colStrength;
  1085. ttemp2.rgb *= TechnicolorProd80Brightness;
  1086.  
  1087. ttarget.rgb = ttemp.grg;
  1088. ttarget2.rgb = ttemp.bbr;
  1089.  
  1090. ttemp.rgb = tsource.rgb - ttarget.rgb;
  1091. ttemp.rgb += ttemp2.rgb;
  1092. ttemp2.rgb = ttemp.rgb - ttarget2.rgb;
  1093.  
  1094. color.rgb = lerp(tsource.rgb, ttemp2.rgb, TechnicolorProd80Strength);
  1095.  
  1096. color.rgb = lerp(dot(color.rgb, 0.333), color.rgb, TechnicolorProd80Saturation);
  1097. }
  1098. //End FiftyTifty Technicolor Prod80
  1099.  
  1100.  
  1101. //Begin FiftyTifty Simple Linear Tonemapping
  1102. if(bFiftyTiftySimpleLinearTonemapping)
  1103. {
  1104. float3 texColor = color.rgb;
  1105. texColor *= FiftyTiftySLTonemappingExposure; // Hardcoded Exposure Adjustment
  1106. color.rgb = pow(texColor,1/2.2);
  1107. }
  1108. //End FiftyTifty Simple Linear Tonemapping
  1109.  
  1110. //Begin FiftyTifty HPD Tonemapping
  1111. if(bFiftyTiftyHPDTonemapping)
  1112. {
  1113. float3 xColor = color.xyz;
  1114. xColor = max(xColor, HPDTonemappingClipping);
  1115. float3 HPDcolor = pow(abs((xColor * (HPDTonemappingUpperTone * xColor + HPDTonemappingGreyTone )) / (xColor * (HPDTonemappingUpperTone * xColor + HPDTonemappingMiddleTone) + HPDTonemappingLowerTone )), HPDTonemappingExposure);
  1116.  
  1117. if(bFiftyTiftyHPDTonemappingMethod)
  1118. {
  1119. color.xyz = lerp(pow(HPDcolor.xyz, 1.0/2.2), color.xyz, HPDTonemappingLerp);
  1120. }
  1121. else
  1122. {
  1123. color.xyz = lerp(HPDcolor.xyz, color.xyz, HPDTonemappingLerp);
  1124. }
  1125. }
  1126. //End FiftyTifty HPD Tonemapping
  1127.  
  1128.  
  1129. //Begin FiftyTifty ColorFilmicTonemapping
  1130. if(bFiftyTiftyColorFilmicTonemapping)
  1131. {
  1132. float3 xColor = color.xyz;
  1133. const float3 A = float3(0.55f, 0.50f, 0.45f); // Shoulder strength
  1134. const float3 B = float3(0.30f, 0.27f, 0.22f); // Linear strength
  1135. const float3 C = float3(0.10f, 0.10f, 0.10f); // Linear angle
  1136. const float3 D = float3(0.10f, 0.07f, 0.03f); // Toe strength
  1137. const float3 E = float3(0.01f, 0.01f, 0.01f); // Toe Numerator
  1138. const float3 F = float3(0.30f, 0.30f, 0.30f); // Toe Denominator
  1139. const float3 W = float3(2.80f, 2.90f, 3.10f); // Linear White Point Value
  1140. const float3 F_linearWhite = ((W*(A*W+C*B)+D*E)/(W*(A*W+B)+D*F))-(E/F);
  1141. float3 F_linearColor = ((xColor*(A*xColor+C*B)+D*E)/(xColor*(A*xColor+B)+D*F))-(E/F);
  1142.  
  1143. color.xyz = pow(saturate(F_linearColor * CFLinearColorMultiplier / F_linearWhite),CFTonemappingPower);
  1144. }
  1145. //End FiftyTifty ColorFilmicTonemapping
  1146.  
  1147.  
  1148. //Begin FiftyTifty Vibrance
  1149. if(bFiftyTiftyVibrance)
  1150. {
  1151. float3 VibCoeff = float3((VibranceR * VibranceIntensity), (VibranceG * VibranceIntensity), (VibranceB * VibranceIntensity));
  1152.  
  1153. float3 VibColor = color.rgb;
  1154.  
  1155. float3 LumCoeff = float3(0.2127, 0.7152, 0.0722);
  1156. float Luma = dot(LumCoeff, VibColor.rgb);
  1157.  
  1158. float VibMaxColor = max(color.r, max(color.g, color.b));
  1159. float VibMinColor = min(color.r, min(color.g, color.b));
  1160.  
  1161. float VibSaturation = VibMaxColor - VibMinColor;
  1162.  
  1163. VibColor.rgb = lerp(Luma, VibColor.rgb, (1.0 + (VibCoeff * (1.0 - (sign(VibCoeff) * VibSaturation)))));
  1164. VibColor.rgb = float3((VibColor.r * VibranceRBrightness), (VibColor.g * VibranceGBrightness), (VibColor.b * VibranceBBrightness)); //Made it possible to adjust the colours' brightness
  1165.  
  1166. color.rgb = VibColor.rgb;
  1167. }
  1168. //End FiftyTifty Vibrance
  1169.  
  1170.  
  1171. _oC0.w=1.0;
  1172. _oC0.xyz=color.xyz;
  1173. return _oC0;
  1174. }
  1175.  
  1176.  
  1177.  
  1178. //switch between vanilla and mine post processing
  1179. technique Draw <string UIName="ENBSeries";>
  1180. {
  1181. pass p0
  1182. {
  1183. VertexShader = compile vs_3_0 VS_Quad();
  1184. PixelShader = compile ps_3_0 PS_Draw();
  1185.  
  1186. ColorWriteEnable=ALPHA|RED|GREEN|BLUE;
  1187. ZEnable=FALSE;
  1188. ZWriteEnable=FALSE;
  1189. CullMode=NONE;
  1190. AlphaTestEnable=FALSE;
  1191. AlphaBlendEnable=FALSE;
  1192. SRGBWRITEENABLE=FALSE;
  1193. }
  1194. }
  1195.  
  1196.  
  1197.  
  1198. float4 PS_Vanilla(VS_OUTPUT_POST IN, float2 vPos : VPOS) : COLOR
  1199. {
  1200. float4 _oC0=0.0;
  1201.  
  1202. float4 _v0=0.0;
  1203.  
  1204. _v0.xy=IN.txcoord0.xy;
  1205. _oC0=tex2D(_s0, _v0.xy); //color
  1206. return _oC0;
  1207. }
  1208.  
  1209. //original shader of post processing
  1210. technique Shader_ORIGINALPOSTPROCESS <string UIName="Vanilla";>
  1211. {
  1212. pass p0
  1213. {
  1214. VertexShader = compile vs_3_0 VS_Quad();
  1215. PixelShader = compile ps_3_0 PS_Vanilla();
  1216.  
  1217. ColorWriteEnable=ALPHA|RED|GREEN|BLUE;
  1218. ZEnable=FALSE;
  1219. ZWriteEnable=FALSE;
  1220. CullMode=NONE;
  1221. AlphaTestEnable=FALSE;
  1222. AlphaBlendEnable=FALSE;
  1223. SRGBWRITEENABLE=FALSE;
  1224. }
  1225. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement