[Skyrim]Highlight Bloom and Dampened Bloom: code and demo

general download section
Post Reply
  • Author
  • Message
Offline
Posts: 66
Joined: 12 Jun 2013, 07:19

[Skyrim]Highlight Bloom and Dampened Bloom: code and demo

Two new bloom effects implemented into enbeffect.fx directly. They are togglable, 100% compatible with default fx file, which means if you are using the default fx, just replace it--plug and play. Non-intrusive but quite noticable changes.

Dampened Bloom:
Demonstration to show the new Dampened Bloom effect I implemented to Skyrim ENB. It dampens the BRIGHTEST parts of the image without changing the midtone or dark parts. Reducing burning hair, grass or any over bright surface at mid day. Again it's highly configurable for day/night/interior and sensitivity.

http://imgur.com/a/ZSHWI



Highlight Bloom:
Here I want to show the new bloom code I call "Highlight Bloom". Demo the difference it brings to the Skyrim ENB bloom effects. As it is named, with this feature enabled, bloom only boosts the brightest parts of the image, leaving the mid-tone/darker parts mostly untouched, and it is configurable separately for day/night/interior.

http://imgur.com/a/fgMmj

As for how they work, I think the code itself is explanatory enough. And you can see the coding standard I followed Jawz :)

Code: Select all

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
// Modified by "wonderfulmore" aka "WM"
// Based on Jawz' 
// "DNI-DN enbeffect.fx files or 
// Exterior/Interior Day and Night separation" 
// 05/31/2013 version				
// 
// Change Log: 
// -------------- 06/17/2013 --------------
// Added two new bloom effect "Highlight Bloom" and "Dampened Bloom" 
// Rearranged post processing code sequence to be compatible with Boris default .fx file 
// Revert palette code to Boris default version to be compatible with default .fx (Palette mix is not working as intended in this file! You can use palette but avoid using palette mix, the result would be unpredictable.)
// Incorporated Bronze316's diffuse bloom code
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//

//++CREDITS++++++++++++++++++++++++++++++++++++++++++++++++++++++/
// Boris: Author of ENBSeries and for providing the math of "Highlight Bloom" and "Dampened Bloom".
// Bronze316: Author of "diffuse bloom".
// Jawz: Author of DNI-DN enbeffect.fx
// Kermles: Author of initial Final Adjustments.				 //
// MTichenor: Author of inital Vanilla Adaptation,				 //
// Vanilla Bloom and Flip code.									 //
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/
Here are the toggles

Code: Select all

#define HIGHLIGHT_BLOOM		1		// WM: Only bloom the brightest parts of the screen, leave midtone and dark parts untouched. 
#define DAMPENED_BLOOM		1		// WM: Dampenes the brightest bloom, preventing blinding surface under intense sunlight. 
And the configuration sections:

Code: Select all

#if (HIGHLIGHT_BLOOM==1)
// WM: parameters for HIGHLIGHT BLOOM. 
// These numbers are fine tuned to make the bloom effect about half effective at midtone. Only turned on for Nights by default. 
// Don't change the parameters unless you understand the math! 
//Exterior							  Night, Day
	float2 BTthresholdExt 	= float2( 2.1, 2.1 ); 		// WM: the higher the value, the lower the brightness threshold.
	float2 BTsensitivityExt = float2( 6.5 , 6.5  ); // WM: how fast the dampen change from no bloom to normal bloom. 
	float2 BTcontrolExt 	= float2( 1.0  , 0.0   ); //WM: how effective is this effect. 1 to be fully effective, 0 to turn off
//Interior							  Night, Day
	float2 BTthresholdInt 	= float2( 2.1, 0.333 ); 
	float2 BTsensitivityInt = float2( 6.5 , 5.0  );
	float2 BTcontrolInt 	= float2( 1.0  , 0.0   );
#endif
//-----------------------------------------------------------------------------------------------------------
#if (DAMPENED_BLOOM==1)
// WM: These numbers are fine toned to only dampen about the top 5-10% bloom by 5%. Only turned on for Exterior Day by default. 
// WM: Don't change the parameters unless you understand the math! 
//Exterior							  Night, Day
	float2 DBAmountExt	 	= float2( 0.7, 0.7 ); // WM: the larger the more the bloom gets dampened	
	float2 DBsensitivityExt = float2( 7.0 , 7.0  ); // WM: how fast the dampen falloff from top to midtone, also affects the dampen amount
	float2 DBcontrolExt 	= float2( 0.0  , 1.0 ); // WM: how effective is this effect. 1 to be fully effective, 0 to turn off
//Interior							  Night, Day
	float2 DBAmountInt	 	= float2( 0.7, 0.7 ); 
	float2 DBsensitivityInt = float2( 7.0 , 7.0  );
	float2 DBcontrolInt 	= float2( 0.0  , 0.0   );
#endif
Download link:
https://drive.google.com/folderview?id= ... sp=sharing

Enjoy and let me know any issues/thoughs :)

Offline
User avatar
*blah-blah-blah maniac*
Posts: 1938
Joined: 05 Mar 2012, 02:08

Re: [Skyrim]Highlight Bloom and Dampened Bloom: code and dem

Some things you need to correct in your file

The diffuse Bloom code is Dpeasent's OBGE converted code with my older DNI code implemented. Bronze got it from me with my older DNI code
The RGB commands in the Diffuse bloom functions as brightness/intensity settings instead of saturation. Both saturation and intensity RGB bloom color control can be achieved through Bloom_Kolorizer.

You don't need to use // just put a 0 after it and the effect is deactivated.

The GAMMA_CORRECTION_PP should be removed as gamma correction is already handled by ENB, so an unnecessary code to have in it. Read more about it here - http://enbdev.com/enbseries/forum/viewt ... 3&start=40

You need to put the BLOOM_KOLORIZER before any of the Bloom types so it affects those bloom types but keep the color.xyz+=xcolorbloom.xyz*EBloomAmount; after everything related to bloom adjustment code.

Also you don't need to have this line of code in the edge bloom r1.xyz+=xcolorbloom*EBloomAmount; if you already have the color.xyz+=xcolorbloom.xyz*EBloomAmount; in the Bloom_Kolorizer, that will double the bloom effect/amount set in the enbseries.ini file.

If you use these;

Code: Select all

		float BTNightDayFactor = ENightDayFactor;
		float BTInteriorFactor = EInteriorFactor;
The flip code will not have any affect on it and renders it useless to have in it if you won't make it backwards compatible for older ENB versions. The whole point of adding the Flip code in it, otherwise just use the ENightDayFactor and EInteriorFactor as is, because it is unnecessary to use "renaming code" if you are not going to attach some other code to it such as the Flip code.
It has no purpose other than to have your initials in it otherwise it is the same as putting the ENightDayFactor and EInteriorFactor directly.

The color.rgb=palette.rgb * palmix; works as an intensity control of the palette color map, not a curve or gamma control and especially not a desaturation control.
HD6 code color.rgb=lerp( color.rgb, palette.rgb, palmix ); alters both palette and regular color.

Offline
Posts: 66
Joined: 12 Jun 2013, 07:19

Re: [Skyrim]Highlight Bloom and Dampened Bloom: code and dem

@Jawz,

That's a lot of pro tips, looks like I have some hard work to do lol. You are awesome, thanks for your file and help.

I really didn't try to understand the math behind diffuse bloom. I just thought it looked good, and ported it into your file. It's working but not conform to the DNI standards. So maybe it's better to just remove it and anyone who's interested in diffuse bloom can add by themselves. Also sorry for the inaccurate credits.

I didn't change GAMMA_CORRECTION_PP in the file. It's disabled by default anyway. You said it's to be removed, will you release another version of your file?

I thought it's alright to put my bloom tweaks before bloom kolorizer. Since my code only changes the bloom strength, but not applied them to original color until the end of bloom_kolorizer. So kolorizer still works even if it's after my bloom tweaks.

I didn't change edge bloom code as well. I was wondering the line in edge bloom "r1.xyz+=xcolorbloom*EBloomAmount;". To me it seems to make the edge bloom twice bright since the similar line is there at the end of kolorizer. So it is safe to remove this line from edge bloom?

You caught me about the redundant flip variables :) I am just reserving some more variables here and there in case I'd do some funky things with flip factors within each of the bloom effects. who knows...

Yeah you are right the palmix is for intensity, my brain has broken :( But anyway I'll keep the old code here since many ENB presets are tweaked based on the old palette code. The new palette code would break the brighness for those who base on the old code.


Another thing I hate to admit is that I got the "dampened bloom" math wrong. The result is "black" bloom or unatural bloom brightness in very bright scenes. I really want to solve this problem. Higher adaptation value can eliminte the over bright bloom, but it's just a intensity multiplier which makes the image looks "flat". Maybe what I am looking for is some more subtle adaptation that modifies the brightness curve or tonemapping?
Post Reply