--JawZ-- ENB resources, updated 15 september-14

general download section
  • Author
  • Message
Offline
User avatar
Posts: 25
Joined: 07 Aug 2012, 19:20

Re: --JawZ-- ENB resources for Skyrim

Optimization of this code means that you can add ALL necessary operations with value into one formula.
So, instead of writing four stings like this:

Code: Select all

 float fVanillaBloom = lerp(fVanillaBloomInt.x, fVanillaBloomInt.y, JKNightDayFactor);
   if ( JKInteriorFactor - 1 ) {
   fVanillaBloom = lerp(fVanillaBloomExt.x, fVanillaBloomExt.y, JKNightDayFactor);
   };
you will write only one:

Code: Select all

float    fVanillaBloom = DNIFactor(fVanillaBloomExt.x, fVanillaBloomExt.y, fVanillaBloomInt.x, fVanillaBloomInt.y, JKNightDayFactor, JKInteriorFactor);
It's just.. you know.. simplier :) (Damn my English teacher!)

Of course, you are right - it's not a really major improvement. It saved a lot of my nerves, so I just thought it can save someone else's nerves too :lol:

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

Re: --JawZ-- ENB resources for Skyrim

Ah I knew I overlooked something :P But as it does the same thing as the code I currently have set up in all the files it would be unnecessary to start over just to cut down on the amount of code lines. though if I it were a very extensive enbeffect.fx like Kermles Advanced PP suite I would most certainly use your DNI code instead, he has 3562 lines in that enbeffect.fx, not all code but most of it at least.

Don't get me wrong it's great that you did share this I always appreciate it when someone shares his codes with the community like this but for the time being it would only give me more work with my files without any real gains beside a few line cut downs. But hopefully someone else will have use of it and I might use it in future files :)

Offline
Posts: 30
Joined: 22 May 2013, 00:27

Re: --JawZ-- ENB resources for Skyrim

Hi JawZ

kermles final adjustments:

change:

Code: Select all

//reverse gamma correction
color.rgb 		= pow(color.rgb, 2.2);
to:

Code: Select all

//reverse gamma correction
color.rgb 		= pow(color.rgb, 2.233333333);
you can also change the restore function to that value, coz it makes no sense:

Code: Select all

//restore gamma correction
color.rgb 		= pow(color.rgb, 0.4545454545);
if you got some question about linear space ...take a look here:
http://chilliant.blogspot.de/2012/08/sr ... -hlsl.html

....and yes, it make a difference in screen-output

i also checked out that true reverse algo from the website:

Code: Select all

color.rgb = max(1.055 * pow(color.rgb, 0.416666667) - 0.055, 0);
with high performance cost and a big diffrence... but you will find some
realtime codes on the site.
iam not a math genius but i will give it a try...

Offline
Posts: 30
Joined: 22 May 2013, 00:27

Re: --JawZ-- ENB resources for Skyrim

First experiment with Contrast-Algo dedicated to Linear Space:
here you can see:
img5.fotos-hochladen.net/uploads/00000000k09dpxnuq128.jpg

changes:

Code: Select all

//reverse gamma correction
color 		= pow(color, 2.233333333); //color.rgb 		= pow(color.rgb, 2.233333333);

Code: Select all

//restore gamma correction
color 		= pow(color, 0.4545454545); //color.rgb 		= pow(color.rgb, 0.4545454545);
additional linear-space-contrast code:

Code: Select all

//Put it after reverse gamma correction
	color = color - 0.9 * (color - 1.0f) * color *(color - 0.5f); //0.9 is the contrast-test-value, play with that value
//saturation follows...
to make it work you have to crank down other contrast-settings in your enbeffect.fx file
but that one will work ways better... beware: messes up your whole settings ;)
...just my output of today... if you wanna play with it ;)

btw. is there are need for that skyrim-look?
img5.fotos-hochladen.net/uploads/00000000k0aprtfz7o21.jpg
....i can help!!! ;)

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

Re: --JawZ-- ENB resources for Skyrim

nexstac:

Thanks for the link and input on Kermles code :) I haven't really dove into those parts yet and only used what he he offered me so thanks for clarifying why those values were used by posting that link ;) He did mention he didn't really know the correct value and applied the values during trial & error runs.

I've been fiddling around with the code a bit more and also looking in other useful codes and info IAN TAYLOR have provided on his blog.

Offline
Posts: 30
Joined: 22 May 2013, 00:27

Re: --JawZ-- ENB resources for Skyrim

JawZ, if you wanna do more research, like me, and if you not afraid to experiment to offer
anytime a usefull shader-combi ...i will post some more of my research stuff, infos, links and so on.
hope you will also post some research code-snippets, here... i will test it ;)
hope, kermles will come back here anytime, for posting some of his new input.
without kermles, i would never entered the enb-scene... coz it is atm my hlsl-experiment-playground, that kermles show´s me :D

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

Re: --JawZ-- ENB resources for Skyrim

That would be great :) I will do that aswell

I have implemented Ian Taylors gamma correction to my files now both to the Final Adjustment and all the Post-Processing with the ability to toggle it off and on in the PP's.

He did some very good additions to the enbeffect.fx code and he mentioned he was working on a new tonemapping code but he didn't release it though.

From one of the message Kermles sent me a while back
I implemented a new tonemapping algorithm based on a scientific research paper, apparently this algorithm gives such high quality results that they use it in the film and photo industries. Info on the algorithm is here:
http://artoolkit.org/research/theses/ma ... ode34.html

My testing was pretty promising, it removes the need to adjust tonemapping controls because tonemapping is automatically controlled by adaptation, and so is contrast. However brightness, contrast and saturation controls can be put in for good measure.
I would have really liked to test out that code of his.

Offline
Posts: 30
Joined: 22 May 2013, 00:27

Re: --JawZ-- ENB resources for Skyrim

he wrote some time ago, that he is trying to get a new tonemapping-white-paper into hlsl code.
he´s so crazy! ;)
hope, he will get it work... coz algos have to work in realtime, you have always make some simple algos, that does not kill the performance.
but... kermles will succeed ...i know it :D

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

Re: --JawZ-- ENB resources for Skyrim

So I've tried to make some sense to the code over at that blog and don't really know if I have made it better or worse by applying this code as the reverse gamma correction code.

Code: Select all

//reverse gamma correction
	color = 0.012522878 * color + 0.682171111 * color * color + 0.305306011 * color.r * color.g * color.b;

// color controls

//restore gamma correction
	color = 0.585122381 * sqrt(color) + 0.783140355 * sqrt(sqrt(color)) - 0.368262736 * sqrt(sqrt(sqrt(color)));
or this

Code: Select all

//reverse gamma correction
	color = pow(color, 2.233333333);

// color controls

//restore gamma correction
	color = max(1.055 * pow(color, 0.416666667) - 0.055, 0);
And I can't see any point in having these seperated like this;

Code: Select all

	//convert to linear colorspace
	color.r 		= 1.0/(1.0+color.r);
	color.g 		= 1.0/(1.0+color.g);
	color.b 		= 1.0/(1.0+color.b);

// gamma and color controls

	//restore dynamic range
	color.r 		= (1.0/color.r)-1.0;
	color.g 		= (1.0/color.g)-1.0;
	color.b 		= (1.0/color.b)-1.0;
instead of just this

Code: Select all

//convert to linear colorspace
	color = 1.0/(1.0+color);

// gamma and color controls

//restore dynamic range
	color = (1.0/color)-1.0;

Any thoughts about these things, anyone?
Last edited by --JawZ-- on 28 May 2013, 17:06, edited 1 time in total.

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

Re: --JawZ-- ENB resources for Skyrim

Here is Kermles default Final Adjustment - http://70.38.64.76/f/1/cf7a4c79-1d73-47 ... 888e5a.bmp

And here is with this gamma code - http://70.38.64.76/f/1/defb601e-89db-4d ... bf182b.bmp

Code: Select all

//reverse gamma correction
   color = 0.012522878 * color + 0.682171111 * color * color + 0.305306011 * color.r * color.g * color.b;

// color controls

//restore gamma correction
   color = 0.585122381 * sqrt(color) + 0.783140355 * sqrt(sqrt(color)) - 0.368262736 * sqrt(sqrt(sqrt(color)));
RGB values was set to 2.0 and CMY values was set to 1.5 in both pictures.
Last edited by --JawZ-- on 29 May 2013, 07:21, edited 1 time in total.
Post Reply