[Fallout4] Histogram based Adaptation

share shaders here
  • Author
  • Message
Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

Re: [Fallout4] Histogram based Adaptation

you can't do that by ENB alone.
The script extender ENB plugin I've made could achieve that, if you're willing to do some CK scripting.
viewtopic.php?f=6&t=5411
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
Posts: 5
Joined: 11 Mar 2017, 10:24

Re: [Fallout4] Histogram based Adaptation

thanks are take a look

Offline
Posts: 31
Joined: 15 Jun 2017, 18:17

Re: [Fallout4] Histogram based Adaptation

so this has been ubiquitous in FO4 and Skyrim ENBs since it appeared back in the day, thanks to kingeric1992 !
Coming back to Skyrim, I noticed that it was not working quite as predictably as in FO4 and followed the source code back to this thread.
kingeric1992 wrote: The luminance detection range is hard coded to -9 (2^-9) to 3 (2^3), which is the range of most of the scene in FO4 I think, judged by histogram bin reassignment. Can't say for sure if it is the same for Skyrim SE. (in Skyrim, it is about 2^-5 to 2^2)
It makes sense now reading that comment. So I was attempting to adjust the code for Skyrim. It appears to be working better now, but wanted some 'real' coders to verify i haven't screwed things up.


notably, changing these lines:

Code: Select all

float  level   = saturate(( color + 9.0 ) / 12) * 63; // [-9, 3]
float adapt = (adaptAnchor.x + adaptAnchor.y) * 0.5 / 63.0  * 12.0 - 9.0;

//  ---- to ----  //

float  level   = saturate(( color + 5.0 ) / 7) * 63; // [-5, 2]
float adapt = (adaptAnchor.x + adaptAnchor.y) * 0.5 / 63.0  * 7.0 - 5.0;  // 
and in the adapt tool:

Code: Select all

float AdaptToolMax    < string UIName="Adapt Max Brightness (log2 scale)"; float UIMin= -9.0; float UIMax=3.0; > = {  1.00 };
float AdaptToolMin    < string UIName="Adapt Min Brightness (log2 scale)"; float UIMin= -9.0; float UIMax=3.0; > = { -4.00 };
float  adapt = saturate((log2(TextureAdaptation.Sample(Sampler0, 0.5).x) + 9.0) / 12.0);
return adapt + float4( 0.0, step(txcoord0.x, (AdaptToolMax + 9.0) / 12.0) * step((AdaptToolMin + 9.0) / 12.0, txcoord0.x) * 0.5, 0.0, 0.0);

//  ---- to ----  //

float AdaptToolMax    < string UIName="Adapt Max Brightness (log2 scale)"; float UIMin= -5.0; float UIMax=2.0; > = {  1.00 };
float AdaptToolMin    < string UIName="Adapt Min Brightness (log2 scale)"; float UIMin= -5.0; float UIMax=2.0; > = { -4.00 };
float  adapt = saturate((log2(TextureAdaptation.Sample(Sampler0, 0.5).x) + 5.0) / 7.0);
return adapt + float4( 0.0, step(txcoord0.x, (AdaptToolMax + 5.0) / 7.0) * step((AdaptToolMin + 5.0) / 7.0, txcoord0.x) * 0.5, 0.0, 0.0);
Would this be correct?

Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

Re: [Fallout4] Histogram based Adaptation

make sense.
should have made them global constant for easy access.
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube
Post Reply