Please use english language
It is currently 22 Oct 2017, 13:29

All times are UTC





Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: 03 Nov 2016, 14:12 
Offline
*sensei*

Joined: 05 Apr 2014, 10:29
Posts: 496
Location: Taiwan
It start with loading textures:
The UV coord of bloom texture has a scaling factor controlled by clamps and a on/off switch.
Code:
    bool   scalebloom  = (0.5<=Params01[0].x);
    float2 scaleduv    = clamp(0.0, Params01[6].zy, Params01[6].xy * IN.txcoord0.xy);
    float4 color       = TextureColor.Sample(Sampler0, IN.txcoord0.xy); //hdr scene color, point sampler
    float4 bloom       = TextureBloom.Sample(Sampler1, (scalebloom)? IN.txcoord0.xy: scaleduv); //linear sampler
    float2 middlegray  = TextureAdaptation.Sample(Sampler1, IN.txcoord0.xy).xy; //.x == current, .y == previous
    middlegray.y = 1.0; //bypass for enbadaptation format



then, the tonemapper"s"
A additional switch for switching between Reinhard-modified and Filmic ALU by Heji
Code:
    bool   UseFilmic   = (0.5<Params01[2].z);
    float  WhiteFactor = Params01[2].y;
   
    float  original_lum = max( dot(LUM_709, color.rgb), DELTA);
    float  lum_scaled   = original_lum * middlegray.y / middlegray.x;
           
    float  lum_filmic = max( lum_scaled - 0.004, 0.0);
           lum_filmic = lum_filmic * (lum_filmic * 6.2 + 0.5)  / (lum_filmic * (lum_filmic * 6.2 + 1.7) + 0.06);
           lum_filmic = pow(lum_filmic, 2.2);          //de-gamma-correction for gamma-corrected tonemapper
           lum_filmic = lum_filmic * WhiteFactor;    //linear scale
   
    float lum_reinhard = lum_scaled * (lum_scaled * WhiteFactor + 1.0) / (lum_scaled + 1.0);
   
    float lum_mapped   = (UseFilmic)? lum_filmic : lum_reinhard; //if filmic
   
    color.rgb = color.rgb * lum_mapped / original_lum;



then do the bloom blending, this part is identical to the old Skyrim.
Code:
    float bloomfactor = Params01[2].x;
    color.rgb = color.rgb + bloom.rgb * saturate(bloomfactor - lum_mapped);


And the imagespace modifiers, mostly the same as the old Skyrim,
but it has a inactive process with Params01[6].w, seemly supposed to have a gamma ops there.
Code:
    float  saturation  = Params01[3].x;   // 0 == gray scale
    float  contrast    = Params01[3].z;   // 0 == no contrast
    float  brightness  = Params01[3].w;   // intensity
   
   
    float3 tint_color  = Params01[4].rgb; // tint color
    float  tint_weight = Params01[4].w;   // 0 == no tint

    float3 fade        = Params01[5].xyz; // fade current scene to specified color, mostly used in special effects
    float  fade_weight = Params01[5].w;   // 0 == no fade
   
    color.a   = dot(color.rgb, LUM_709);
    color.rgb = lerp(color.a, color.rgb, saturation);
    color.rgb = lerp(color.rgb, tint_color * color.a , tint_weight);
    color.rgb = lerp(middlegray.x, color.rgb * brightness, contrast);
//    color.rgb = pow(saturate(color.rgb), Params01[6].w); //this line is unused??
    color.rgb = lerp(color.rgb, fade, fade_weight);
    color.a = 1.0;

_________________
Intel Xeon L5639 6C12T @3.96GHz // Gigabyte ga-x58a-ud3r// MSI GTX680 4G// 24G RAM
Flickr
YouTube


Last edited by kingeric1992 on 10 Jan 2017, 03:00, edited 3 times in total.

Top
 Profile  
 
Tomoko
PostPosted: 03 Nov 2016, 23:49 
Offline
User avatar

Joined: 08 Nov 2013, 07:42
Posts: 77
Location: Taiwan
Hell yeah~ ;) ;)

_________________
Observing the world with aesthetic taste.


Top
 Profile  
 
PostPosted: 04 Nov 2016, 00:53 
Offline
*master*
User avatar

Joined: 08 Nov 2012, 15:24
Posts: 130
This is really interesting. Thank you very much.

_________________
Try my mods! | Resonant ENB for Dragon's Dogma | IAXE2 for Fallout 4 | Luminous ENB for Skyrim SE


Top
 Profile  
 
PostPosted: 05 Nov 2016, 23:00 
Offline
*master*

Joined: 10 May 2015, 04:33
Posts: 143
Now to learn how to take that and apply it :) lol..... baby steps... one day....


Top
 Profile  
 
PostPosted: 13 Nov 2016, 08:43 
Offline
*master*
User avatar

Joined: 08 Nov 2012, 15:24
Posts: 130
A small bug - tint_color and tint_weight should refer to Params01[4], not Params01[3].

While this may be obvious to some people, I feel I should note that as ENB doesn't have a UseOriginalAdaptation option, you'll need to replace the code for lum_scaled with one designed around ENB's adaptation system, which is single channel. Otherwise, you'll get a black screen.

_________________
Try my mods! | Resonant ENB for Dragon's Dogma | IAXE2 for Fallout 4 | Luminous ENB for Skyrim SE


Last edited by roxahris on 13 Nov 2016, 15:10, edited 1 time in total.

Top
 Profile  
 
PostPosted: 13 Nov 2016, 09:28 
Offline
*sensei*

Joined: 05 Apr 2014, 10:29
Posts: 496
Location: Taiwan
@roxahris

Indeed. thanks for the reply.

post updated.

_________________
Intel Xeon L5639 6C12T @3.96GHz // Gigabyte ga-x58a-ud3r// MSI GTX680 4G// 24G RAM
Flickr
YouTube


Top
 Profile  
 
PostPosted: 03 Jan 2017, 09:46 
Offline
User avatar

Joined: 30 Jan 2016, 11:26
Posts: 89
Location: France
I found what is the coef definition for LUM_709 (just in case, is that right: "0.2126, 0.7152, 0.0722"?) but what should be used for DELTA, what is this variable ?

_________________
Released ENB: PRC - PRT - Painterly' | FO4 mods: NAC | Videos: ::Virtual.Camera::


Top
 Profile  
 
PostPosted: 03 Jan 2017, 14:52 
Offline
*sensei*
User avatar

Joined: 30 Jan 2012, 13:18
Posts: 464
Assuming from the code, just some very small value, so the original lum can never be 0, hence avoiding the division through 0 in the last line of the tonemapper. It's very common in shadercode to do stuff like this, max(x,0.00000001) for instance.


Top
 Profile  
 
PostPosted: 03 Jan 2017, 16:40 
Offline
User avatar

Joined: 30 Jan 2016, 11:26
Posts: 89
Location: France
Ho I see, it works.
Thanks both of you McFly and Kingeric, my AGCC is working great now !

_________________
Released ENB: PRC - PRT - Painterly' | FO4 mods: NAC | Videos: ::Virtual.Camera::


Top
 Profile  
 
PostPosted: 04 Jan 2017, 06:27 
Offline
*blah-blah-blah maniac*
User avatar

Joined: 31 Mar 2012, 15:06
Posts: 1425
Location: France
l00
Would you mind sharing your effect.fx ?

_________________
Obsidian 900D, AX1500i, Eisbaer 420, i7 6850K@4.425 Ghz, MSI X99 Raider, SLI 2x1080Ti 11G VRAM, 32G RAM@3371, 950 Pro M2, 10 Tb HDDs, W10 Pro 64
Image
K ENB Pure Light SE
K ENB Pure Light
Kountervibe ENB
Kinematic ENB


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2, 3  Next

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group