Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.29 KB | None | 0 0
  1. //++++++++++++++++++++++++++++++++++++++++++++
  2. // ENBSeries effect file
  3. // visit http://enbdev.com for updates
  4. // Copyright (c) 2007-2012 Boris Vorontsov
  5. //++++++++++++++++++++++++++++++++++++++++++++
  6.  
  7. #ifndef POSTPROCESS
  8. #define POSTPROCESS 3
  9. #endif
  10.  
  11. //+++++++++++++++++++++++++++++
  12. //internal parameters, can be modified
  13. //+++++++++++++++++++++++++++++
  14. //float3 EColorFilter=float3(1.0, 0.9, 0.9);
  15.  
  16. //modify these values to tweak various color processing
  17.  
  18. //POSTPROCESS 3
  19. float EAdaptationMinV3=0.05;
  20. float EAdaptationMaxV3=0.05;
  21. float EToneMappingCurveV3=1.0;
  22. float EToneMappingOversaturationV3=10.0;
  23.  
  24. //begin NLA Adaptation
  25. float AdaptationMinInterior = 0.015;
  26.  
  27. float AdaptationMaxInterior = 0.015;
  28.  
  29. float AdaptationMinDay = 0.015;
  30.  
  31. float AdaptationMaxDay = 0.015;
  32.  
  33. float AdaptationMinNight = 0.015;
  34.  
  35. float AdaptationMaxNight = 0.015;
  36. //End
  37.  
  38. //begin NLA Palette
  39. float PaletteDay = 1.475;
  40.  
  41. float PaletteNight = 1.475;
  42.  
  43. float PaletteInterior = 1.475;
  44.  
  45. float PaletteBrightnessDay = 1.0;
  46.  
  47. float PaletteBrightnessNight = 1.0;
  48.  
  49. float PaletteBrightnessInterior = 3.0;
  50. //End
  51.  
  52. //begin NLA Color
  53. float GammaDay = 1.2;
  54.  
  55. float GammaNight = 1.2;
  56.  
  57. float GammaInterior = 1.2;
  58.  
  59. float DesatRDay = 1.0;
  60.  
  61. float DesatRNight = 1.0;
  62.  
  63. float DesatRInterior = 1.0;
  64.  
  65. float DesatGDay = 1.0;
  66.  
  67. float DesatGNight = 1.0;
  68.  
  69. float DesatGInterior = 1.0;
  70.  
  71. float DesatBDay = 0.9;
  72.  
  73. float DesatBNight = 1.0;
  74.  
  75. float DesatBInterior = 0.9;
  76. //End
  77.  
  78. //begin NLA Tonemapping
  79.  
  80. float IntensityContrastDay = 1.5;
  81.  
  82. float IntensityContrastNight = 1.5;
  83.  
  84. float IntensityContrastInterior = 1.5;
  85.  
  86. float SaturationDay = 1.0;
  87.  
  88. float SaturationNight = 1.0;
  89.  
  90. float SaturationInterior = 1.0;
  91.  
  92. float ToneMappingCurveDay = 2.0;
  93.  
  94. float ToneMappingCurveNight = 2.0;
  95.  
  96. float ToneMappingCurveInterior = 2.0;
  97.  
  98. float ToneMappingOversaturationDay = 40.0;
  99.  
  100. float ToneMappingOversaturationNight = 40.0;
  101.  
  102. float ToneMappingOversaturationInterior = 40.0;
  103.  
  104. //End
  105.  
  106. //begin NLA Brightness
  107.  
  108. float BrightnessDay = 0.22;
  109.  
  110. float BrightnessNight = 0.10;
  111.  
  112. float BrightnessInterior = 0.22;
  113.  
  114. float BrightnessCurveDay = 1.05;
  115.  
  116. float BrightnessCurveNight = 1.05;
  117.  
  118. float BrightnessCurveInterior = 1.05;
  119.  
  120. float BrightnessMultiplierDay = 0.9;
  121.  
  122. float BrightnessMultiplierNight = 0.9;
  123.  
  124. float BrightnessMultiplierInterior = 0.9;
  125.  
  126. float BrightnessToneMappingCurveDay = 0.7;
  127.  
  128. float BrightnessToneMappingCurveNight = 0.7;
  129.  
  130. float BrightnessToneMappingCurveInterior = 0.7;
  131.  
  132. //end NLA Brightness
  133.  
  134. //begin Vibrance
  135. float VibranceAmount = 0.50; // 1.00 = None, 0.0001 = Fuckloads
  136.  
  137. float VibranceIntensity = 1.00;
  138.  
  139. float VibranceR = 1.00;
  140.  
  141. float VibranceRBrightness = 1.00;
  142.  
  143. float VibranceG = 0.9;
  144.  
  145. float VibranceGBrightness = 1.00;
  146.  
  147. float VibranceB = 0.90;
  148.  
  149. float VibranceBBrightness = 1.00;
  150. //end Vibrance
  151.  
  152. //begin HPD Tonemapping
  153.  
  154. float HPDTonemappingExposure = 2.2f;
  155.  
  156. float HPDTonemappingClipping = 0.004f;
  157.  
  158. float HPDTonemappingUpperTone = 6.2f;
  159.  
  160. float HPDTonemappingGreyTone = 0.5f;
  161.  
  162. float HPDTonemappingMiddleTone = 1.7f;
  163.  
  164. float HPDTonemappingLowerTone = 0.06;
  165.  
  166. float HPDTonemappingLerp = 0.5;
  167.  
  168. //end HPD Tonemapping
  169.  
  170.  
  171.  
  172. //+++++++++++++++++++++++++++++
  173. //external parameters, do not modify
  174. //+++++++++++++++++++++++++++++
  175. //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
  176. float4 tempF1; //0,1,2,3
  177. float4 tempF2; //5,6,7,8
  178. float4 tempF3; //9,0
  179. //x=generic timer in range 0..1, period of 16777216 ms (4.6 hours), w=frame time elapsed (in seconds)
  180. float4 Timer;
  181. //x=Width, y=1/Width, z=ScreenScaleY, w=1/ScreenScaleY
  182. float4 ScreenSize;
  183. //changes in range 0..1, 0 means that night time, 1 - day time
  184. float ENightDayFactor;
  185. //changes 0 or 1. 0 means that exterior, 1 - interior
  186. float EInteriorFactor;
  187. //enb version of bloom applied, ignored if original post processing used
  188. float EBloomAmount;
  189.  
  190.  
  191.  
  192. texture2D texs0;//color oblivion
  193. texture2D texs1;//bloom oblivion
  194. texture2D texs2;//adaptaion oblivion
  195. texture2D texs3;//bloom enb
  196. texture2D texs4;//adaptation enb
  197. texture2D texs7;//palette enb
  198.  
  199. sampler2D _s0 = sampler_state
  200. {
  201. Texture = <texs0>;
  202. MinFilter = POINT;//
  203. MagFilter = POINT;//
  204. MipFilter = NONE;//LINEAR;
  205. AddressU = Clamp;
  206. AddressV = Clamp;
  207. SRGBTexture=FALSE;
  208. MaxMipLevel=0;
  209. MipMapLodBias=0;
  210. };
  211.  
  212. sampler2D _s1 = sampler_state
  213. {
  214. Texture = <texs1>;
  215. MinFilter = LINEAR;//
  216. MagFilter = LINEAR;//
  217. MipFilter = NONE;//LINEAR;
  218. AddressU = Clamp;
  219. AddressV = Clamp;
  220. SRGBTexture=FALSE;
  221. MaxMipLevel=0;
  222. MipMapLodBias=0;
  223. };
  224.  
  225. sampler2D _s2 = sampler_state
  226. {
  227. Texture = <texs2>;
  228. MinFilter = LINEAR;//
  229. MagFilter = LINEAR;//
  230. MipFilter = NONE;//LINEAR;
  231. AddressU = Clamp;
  232. AddressV = Clamp;
  233. SRGBTexture=FALSE;
  234. MaxMipLevel=0;
  235. MipMapLodBias=0;
  236. };
  237.  
  238. sampler2D _s3 = sampler_state
  239. {
  240. Texture = <texs3>;
  241. MinFilter = LINEAR;//
  242. MagFilter = LINEAR;//
  243. MipFilter = NONE;//LINEAR;
  244. AddressU = Clamp;
  245. AddressV = Clamp;
  246. SRGBTexture=FALSE;
  247. MaxMipLevel=0;
  248. MipMapLodBias=0;
  249. };
  250.  
  251. sampler2D _s4 = sampler_state
  252. {
  253. Texture = <texs4>;
  254. MinFilter = LINEAR;//
  255. MagFilter = LINEAR;//
  256. MipFilter = NONE;//LINEAR;
  257. AddressU = Clamp;
  258. AddressV = Clamp;
  259. SRGBTexture=FALSE;
  260. MaxMipLevel=0;
  261. MipMapLodBias=0;
  262. };
  263.  
  264. sampler2D _s7 = sampler_state
  265. {
  266. Texture = <texs7>;
  267. MinFilter = LINEAR;
  268. MagFilter = LINEAR;
  269. MipFilter = NONE;
  270. AddressU = Clamp;
  271. AddressV = Clamp;
  272. SRGBTexture=FALSE;
  273. MaxMipLevel=0;
  274. MipMapLodBias=0;
  275. };
  276.  
  277. struct VS_OUTPUT_POST
  278. {
  279. float4 vpos : POSITION;
  280. float2 txcoord0 : TEXCOORD0;
  281. };
  282. struct VS_INPUT_POST
  283. {
  284. float3 pos : POSITION;
  285. float2 txcoord0 : TEXCOORD0;
  286. };
  287.  
  288.  
  289.  
  290. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  291. //
  292. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  293. VS_OUTPUT_POST VS_Quad(VS_INPUT_POST IN)
  294. {
  295. VS_OUTPUT_POST OUT;
  296.  
  297. OUT.vpos=float4(IN.pos.x,IN.pos.y,IN.pos.z,1.0);
  298.  
  299. OUT.txcoord0.xy=IN.txcoord0.xy;
  300.  
  301. return OUT;
  302. }
  303.  
  304.  
  305.  
  306. //oblivion shader specific externals, do not modify
  307. float4 _c1 : register(c1);
  308.  
  309. float4 PS_B8104A59(VS_OUTPUT_POST IN, float2 vPos : VPOS) : COLOR
  310. {
  311. float4 _oC0=0.0; //output
  312.  
  313. float4 r0;
  314. float4 r1;
  315. float4 r2;
  316. float4 r3;
  317. float4 r4;
  318. float4 r5;
  319. float4 r6;
  320. float4 r7;
  321. float4 r8;
  322. float4 r9;
  323. float4 r10;
  324. float4 r11;
  325.  
  326.  
  327. float4 _v0=0.0;
  328.  
  329. _v0.xy=IN.txcoord0.xy;
  330. r1=tex2D(_s0, _v0.xy); //color
  331.  
  332. //apply bloom
  333. float4 xcolorbloom=tex2D(_s3, _v0.xy);
  334.  
  335. xcolorbloom.xyz=xcolorbloom-r1;
  336. xcolorbloom.xyz=max(xcolorbloom, 0.0);
  337. r1.xyz+=xcolorbloom*EBloomAmount;
  338.  
  339. r11=r1; //my bypass
  340. _oC0.xyz=r1.xyz; //for future use without game color corrections
  341.  
  342.  
  343. #ifdef APPLYGAMECOLORCORRECTION
  344. //apply original
  345. // HDRParam c1 1
  346. // Src0 s0 1
  347. // DestBlend s1 1
  348. // AvgLum s2 1
  349. //s1 - bloom
  350. //s0 - color
  351. r2=tex2D(_s2, IN.txcoord0.xy);
  352. r1=tex2D(_s1, IN.txcoord0.xy);
  353. r0=tex2D(_s0, IN.txcoord0.xy);
  354. r2.x=dot(r2.xyz, 1.0);
  355. r0.w=max(r2.x, _c1.x);
  356. r0.w=1.0/r0.w;
  357. r1.w=r0.w * 0.5;
  358. r2.xyz=r1.xyz * r1.w;
  359. r0.w=r0.w * _c1.x;
  360. r1.xyz=max(r2.xyz, 0.0);
  361. r0.xyz=r0.w * r0.xyz + r1.xyz;
  362. r0.w=1.0;
  363. _oC0=r0;
  364.  
  365. #endif //APPLYGAMECOLORCORRECTION
  366.  
  367.  
  368.  
  369. float4 color=_oC0;
  370.  
  371.  
  372. //adaptation in time
  373. float4 Adaptation=tex2D(_s4, 0.5);
  374. float grayadaptation=max(max(Adaptation.x, Adaptation.y), Adaptation.z);
  375.  
  376. //Set up realtime vars
  377.  
  378. ToneMappingCurveDay = tempF1.x;
  379. ToneMappingCurveNight = tempF1.y;
  380. ToneMappingCurveInterior = tempF1.z;
  381.  
  382. ToneMappingOversaturationDay = tempF1.w;
  383. ToneMappingOversaturationNight = tempF2.x;
  384. ToneMappingOversaturationInterior = tempF2.y;
  385.  
  386. IntensityContrastDay = tempF2.z;
  387. IntensityContrastNight = tempF2.w;
  388. IntensityContrastInterior = tempF3.x;
  389.  
  390. //End
  391.  
  392. //begin Paste01
  393. float fGamma = lerp(GammaNight, GammaDay, ENightDayFactor);
  394. fGamma = lerp(fGamma, GammaInterior, EInteriorFactor);
  395.  
  396. float DesatR = lerp(DesatRNight, DesatRDay, ENightDayFactor);
  397. DesatR = lerp(DesatR, DesatRInterior, EInteriorFactor);
  398.  
  399. float DesatG = lerp(DesatGNight, DesatGDay, ENightDayFactor);
  400. DesatG = lerp(DesatG, DesatGInterior, EInteriorFactor);
  401.  
  402. float DesatB = lerp(DesatBNight, DesatBDay, ENightDayFactor);
  403. DesatB = lerp(DesatB, DesatBInterior, EInteriorFactor);
  404.  
  405.  
  406. float AdaptationMin = lerp(AdaptationMinNight, AdaptationMinDay, ENightDayFactor);
  407. AdaptationMin = lerp(AdaptationMin, AdaptationMinInterior, EInteriorFactor);
  408.  
  409. float AdaptationMax = lerp(AdaptationMaxNight, AdaptationMaxDay, ENightDayFactor);
  410. AdaptationMax = lerp(AdaptationMax, AdaptationMaxInterior, EInteriorFactor);
  411.  
  412.  
  413. float Saturation = lerp(SaturationNight, SaturationDay, ENightDayFactor);
  414. Saturation = lerp(Saturation, SaturationInterior, EInteriorFactor);
  415.  
  416.  
  417. float ToneMappingCurve = lerp(ToneMappingCurveNight, ToneMappingCurveDay, ENightDayFactor);
  418. ToneMappingCurve = lerp(ToneMappingCurve, ToneMappingCurveInterior, EInteriorFactor);
  419.  
  420. float ToneMappingOversaturation = lerp(ToneMappingOversaturationNight, ToneMappingOversaturationDay, ENightDayFactor);
  421. ToneMappingOversaturation = lerp(ToneMappingOversaturation, ToneMappingOversaturationInterior, EInteriorFactor);
  422.  
  423.  
  424. float IntensityContrast = lerp(IntensityContrastNight, IntensityContrastDay, ENightDayFactor);
  425. IntensityContrast = lerp(IntensityContrast, IntensityContrastInterior, EInteriorFactor);
  426.  
  427.  
  428. float Brightness = lerp(BrightnessNight, BrightnessDay, ENightDayFactor);
  429. Brightness = lerp(Brightness, BrightnessInterior, EInteriorFactor);
  430.  
  431. float BrightnessCurve = lerp(BrightnessCurveNight, BrightnessCurveDay, ENightDayFactor);
  432. BrightnessCurve=lerp(BrightnessCurve, BrightnessCurveInterior, EInteriorFactor);
  433.  
  434. float BrightnessMultiplier = lerp(BrightnessMultiplierNight, BrightnessMultiplierDay, ENightDayFactor);
  435. BrightnessMultiplier = lerp(BrightnessMultiplier, BrightnessMultiplierInterior, EInteriorFactor);
  436.  
  437. float BrightnessToneMappingCurve = lerp(BrightnessToneMappingCurveNight, BrightnessToneMappingCurveDay, ENightDayFactor);
  438. BrightnessToneMappingCurve = lerp(BrightnessToneMappingCurve, BrightnessToneMappingCurveInterior, EInteriorFactor);
  439.  
  440.  
  441. float greyscale = dot(color.xyz, float3(0.3, 0.59, 0.11));
  442. color.r = lerp(greyscale, color.r, DesatR);
  443. color.g = lerp(greyscale, color.g, DesatG);
  444. color.b = lerp(greyscale, color.b, DesatB);
  445.  
  446.  
  447. color.xyz = pow(color, fGamma);
  448.  
  449.  
  450. //end Paste01
  451.  
  452.  
  453.  
  454. #if (POSTPROCESS==3)
  455.  
  456. grayadaptation = max(grayadaptation, 0.0);
  457. grayadaptation = min(grayadaptation, 50.0);
  458. color.xyz = color.xyz / (grayadaptation * AdaptationMax + AdaptationMin);//*tempF1.x
  459.  
  460.  
  461. //begin Paste02
  462.  
  463. color.xyz *= Brightness;
  464. color.xyz += 0.000001;
  465. float3 xncol = normalize(color.xyz);
  466. float3 scl = color.xyz / xncol.xyz;
  467. scl = pow(scl, IntensityContrast);
  468. xncol.xyz = pow(xncol.xyz, Saturation);
  469. color.xyz = scl * xncol.xyz;
  470.  
  471. float lumamax = ToneMappingOversaturation;
  472. color.xyz = (color.xyz * (1.0 + color.xyz / lumamax)) / (color.xyz + ToneMappingCurve);
  473.  
  474. float Y = dot(color.xyz, float3(0.299, 0.587, 0.114)); //0.299 * R + 0.587 * G + 0.114 * B;
  475. float U = dot(color.xyz, float3(-0.14713, -0.28886, 0.436)); //-0.14713 * R - 0.28886 * G + 0.436 * B;
  476. float V = dot(color.xyz, float3(0.615, -0.51499, -0.10001)); //0.615 * R - 0.51499 * G - 0.10001 * B;
  477.  
  478. Y = pow(Y, BrightnessCurve);
  479. Y = Y * BrightnessMultiplier;
  480. Y = Y / (Y + BrightnessToneMappingCurve);
  481. float desaturatefact = saturate(Y * Y * Y *1.7);
  482. U = lerp(U, 0.0, desaturatefact);
  483. V = lerp(V, 0.0, desaturatefact);
  484. color.xyz = V * float3(1.13983, -0.58060, 0.0) + U * float3(0.0, -0.39465, 2.03211) + Y;
  485. //end Paste02
  486.  
  487.  
  488. lumamax = EToneMappingOversaturationV3;
  489. color.xyz = (color.xyz * (1.0 + color.xyz / lumamax)) / (color.xyz + EToneMappingCurveV3);
  490.  
  491. #endif
  492.  
  493. //color.xyz=tex2D(_s0, _v0.xy) + xcolorbloom.xyz*float3(0.7, 0.6, 1.0)*0.5;
  494. //color.xyz=tex2D(_s0, _v0.xy) + xcolorbloom.xyz*float3(0.7, 0.6, 1.0)*0.5;
  495. //color.xyz*=0.7;
  496.  
  497.  
  498.  
  499. //pallete texture (0.082+ version feature)
  500. #ifdef E_CC_PALETTE
  501.  
  502. //begin Paste03
  503.  
  504. float fPalette = lerp(PaletteNight, PaletteDay, ENightDayFactor);
  505. fPalette = lerp(fPalette, PaletteInterior, EInteriorFactor);
  506.  
  507. float PaletteBrightness = lerp(PaletteBrightnessNight, PaletteBrightnessDay, ENightDayFactor);
  508. PaletteBrightness = lerp(PaletteBrightness, PaletteBrightnessInterior, EInteriorFactor);
  509.  
  510. color.rgb = saturate(color.rgb);
  511. float3 brightness = Adaptation.xyz;//tex2D(_s4, 0.5);//adaptation luminance
  512. brightness = (brightness / (brightness + PaletteBrightness));//new version
  513.  
  514. brightness = max(brightness.x, max(brightness.y, brightness.z));//new version
  515. float3 palette;
  516. float4 uvsrc=0.0;
  517. uvsrc.y = brightness.r;
  518. uvsrc.x = color.r;
  519. palette.r = tex2Dlod(_s7, uvsrc).r;
  520. uvsrc.x = color.g;
  521. uvsrc.y = brightness.g;
  522. palette.g = tex2Dlod(_s7, uvsrc).g;
  523. uvsrc.x = color.b;
  524. uvsrc.y = brightness.b;
  525. palette.b = tex2Dlod(_s7, uvsrc).b;
  526.  
  527. color.rgb = palette.rgb * fPalette;
  528. //end Paste03
  529. #endif //E_CC_PALETTE
  530.  
  531.  
  532. //Vibrance
  533. float3 VibCoeff = float3((VibranceR * VibranceIntensity), (VibranceG * VibranceIntensity), (VibranceB * VibranceIntensity));
  534.  
  535. float3 VibColor = color.rgb;
  536.  
  537. float3 LumCoeff = float3(0.2127, 0.7152, 0.0722);
  538. float Luma = dot(LumCoeff, VibColor.rgb);
  539.  
  540. float VibMaxColor = max(color.r, max(color.g, color.b));
  541. float VibMinColor = min(color.r, min(color.g, color.b));
  542.  
  543. float VibSaturation = VibMaxColor - VibMinColor;
  544.  
  545. VibColor.rgb = lerp(Luma, VibColor.rgb, (1.0 + (VibCoeff * (1.0 - (sign(VibCoeff) * VibSaturation)))));
  546. VibColor.rgb = float3((VibColor.r * VibranceRBrightness), (VibColor.g * VibranceGBrightness), (VibColor.b * VibranceBBrightness)); //Made it possible to adjust the colours' brightness
  547.  
  548. color.rgb = lerp(VibColor.rgb, color.rgb, VibranceAmount);
  549. //End
  550.  
  551. //HPD Tonemapping
  552. float3 HPDcolor = color.xyz;
  553. HPDcolor = max(HPDcolor, HPDTonemappingClipping);
  554. HPDcolor = pow(abs((HPDcolor * (HPDTonemappingUpperTone * HPDcolor + HPDTonemappingGreyTone )) / (HPDcolor * (HPDTonemappingUpperTone * HPDcolor + HPDTonemappingMiddleTone) + HPDTonemappingLowerTone )), HPDTonemappingExposure);
  555.  
  556. color.xyz = lerp(HPDcolor.xyz, color.xyz, HPDTonemappingLerp);
  557. //End
  558.  
  559.  
  560. _oC0.w=1.0;
  561. _oC0.xyz=color.xyz;
  562. return _oC0;
  563. }
  564.  
  565.  
  566.  
  567. //switch between vanilla and mine post processing
  568. #ifndef ENB_FLIPTECHNIQUE
  569. technique Shader_B8104A59
  570. #else
  571. technique Shader_ORIGINALPOSTPROCESS
  572. #endif
  573. {
  574. pass p0
  575. {
  576. VertexShader = compile vs_3_0 VS_Quad();
  577. PixelShader = compile ps_3_0 PS_B8104A59();
  578.  
  579. ColorWriteEnable=ALPHA|RED|GREEN|BLUE;
  580. ZEnable=FALSE;
  581. ZWriteEnable=FALSE;
  582. CullMode=NONE;
  583. AlphaTestEnable=FALSE;
  584. AlphaBlendEnable=FALSE;
  585. SRGBWRITEENABLE=FALSE;
  586. }
  587. }
  588.  
  589.  
  590.  
  591. //original shader of post processing
  592. #ifndef ENB_FLIPTECHNIQUE
  593. technique Shader_ORIGINALPOSTPROCESS
  594. #else
  595. technique Shader_B8104A59
  596. #endif
  597. {
  598. pass p0
  599. {
  600. //VertexShader = compile vs_3_0 VS_Quad();
  601. VertexShader=
  602. asm
  603. {
  604. // float4 texRatio0;
  605. // float4 texRatio1;
  606. //
  607. //
  608. // Registers:
  609. //
  610. // Name Reg Size
  611. // ------------ ----- ----
  612. // texRatio0 c6 1
  613. // texRatio1 c7 1
  614.  
  615. vs_1_1
  616. dcl_position v0
  617. dcl_texcoord v1
  618. // mad oT0.xy, v1, c6, c6.zwzw
  619. // mad oT1.xy, v1, c7, c7.zwzw
  620. mov oT0.xy, v1
  621. mov oT1.xy, v1
  622. mov oPos, v0
  623. };
  624. PixelShader=
  625. asm
  626. {
  627. // sampler2D AvgLum;
  628. // sampler2D DestBlend;
  629. // float4 HDRParam;
  630. // sampler2D Src0;
  631. //
  632. //
  633. // Registers:
  634. //
  635. // Name Reg Size
  636. // ------------ ----- ----
  637. // HDRParam c1 1
  638. // Src0 s0 1
  639. // DestBlend s1 1
  640. // AvgLum s2 1
  641. //s0 - bloom
  642. //s1 - color
  643. ps_2_x
  644. def c0, 1, 0.5, 0, 0
  645. dcl t0.xy
  646. dcl t1.xy
  647. dcl_2d s0
  648. dcl_2d s1
  649. dcl_2d s2
  650. texld r2, t0, s2
  651. texld r1, t0, s0
  652. texld r0, t1, s1
  653. dp3 r2.x, r2, c0.x
  654. max r0.w, r2.x, c1.x
  655. rcp r0.w, r0.w
  656. mul r1.w, r0.w, c0.y
  657. mul r2.xyz, r1, r1.w
  658. mul r0.w, r0.w, c1.x
  659. max r1.xyz, r2, c0.z
  660. mad r0.xyz, r0.w, r0, r1
  661. mov r0.w, c0.x
  662. mov oC0, r0
  663. };
  664. ColorWriteEnable=ALPHA|RED|GREEN|BLUE;
  665. ZEnable=FALSE;
  666. ZWriteEnable=FALSE;
  667. CullMode=NONE;
  668. AlphaTestEnable=FALSE;
  669. AlphaBlendEnable=FALSE;
  670. SRGBWRITEENABLE=FALSE;
  671. }
  672. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement