TES Skyrim 0.188

Forum rules
new topics are not allowed in this subsection, only replies.
  • Author
  • Message
Offline
User avatar
*blah-blah-blah maniac*
Posts: 17559
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: TES Skyrim 0.188

No, this code will not work it's just an example. In case of my enbeffect.fx shader it must be inserted between these two lines:
r1.xyz+=xcolorbloom*EBloomAmount;
r11=r1; //my bypass
and the code itself is:

Code: Select all

float CCBrightness=lerp(CCBrightnessNight, CCBrightnessDay, ENightDayFactor);
float CCGamma=lerp(CCGammaNight, CCGammaDay, ENightDayFactor);
r1.xyz=pow(r1.xyz, CCGamma);
r1.xyz*=CCBrightness;
Where CCBrightnessNight, CCBrightnessDay, CCGammaNight, CCGammaDay are global variables set by you, write them somewhere after

Code: Select all

float EBloomAmount;
for example:

Code: Select all

const float CCBrightnessNight=1.0;
const float CCBrightnessDay=1.0;
const float CCGammaNight=1.0;
const float CCGammaDay=1.0;
Btw, i forgot that brightness multiplier is applied after gamma, it's very important actually, so my previous example give not same result as internal brightness and gamma parameters.
If you have modified shader, then find where tex2D or tex2Dlod instruction used to to read _s0 and _s3 texture samplers, their output must be modified by math in this example.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

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

Re: TES Skyrim 0.188

@far327,
In the end, I'm attempting to get a fake SSAO appearance by controlling contrast perfectly to add shadow depth while still highlighting character details such as natural flush skin tones. I know it sounds stupid to some, but it's a config I see a lot of potential in if I had the correct parameters to bring it to life.
Genereal contrast just brighten pixels above a certain luminance, while darken pixels below the same luminance. This is ok for static image, since you can adjust gamma and contrast turn point freely to get a matching result. In a video game, such contrast can be a disaster since the "middle" luminance is constantly changing, the definition of what is "shadow" and what is "highlight" varies greatly even in a few seconds.

The alternative is to know the "local" average luminance, and apply contrast based on it. So the pixels are only brighten/darken comparing to their nearby pixels. The look will be more sutble and visually correct. This is usually known as local contrast enhancement or unsharpen masking. if you have photoshop, try USM filter, it works exactly like this.

To know the local average luminance, typical method is to get the gaussian blurred version of the original image and completely desaturate it. In ENB series, bloom texture itself is very close to a gaussian blurred original color, use it as a cheat but the sharpness is fixed by bloom sampling code, or do your own blur sampling.

However, keep in mind this is not similar to SSAO. SSAO generates shadows, while contrast enhance shadows. If there's no SSAO, there will be no shadow for contrast to enhance. So you will get a better image by applying contrast, but the look will be VERY different with/without SSAO.

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17559
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: TES Skyrim 0.188

Fake ssao combined with blurred image for shadowing isn't hard task, depth data available, multipasses for blurred image of darkness also.
I don't like contrast, because it use invalid math from some other universe, much better for hdr data to make separate computations for color and luma, apply "contrast" and then restore colors, no issues with intensity. It's like to shoot black-white photos on celluloid and then "print" them in laboratory (can't explain with my knowledge of engrish), you can make night the same as day or day as night if experienced enough photographer.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
User avatar
*blah-blah-blah maniac*
Posts: 1498
Joined: 31 Mar 2012, 15:06
Location: France

Re: TES Skyrim 0.188

Boris
thanx for these explanations about contrast and gammas...
OK, I can plainly confirm I'm an ass :lol:
I forgot that I tried to separate adaptation values in my PP of effect.fx when going from 0.186 to 0.187, then 0.188, this part : (lerping based on first --Jawz--'s separations)

#if (POSTPROCESS==7)
float AdaptationBrightness = lerp( AdaptationBrightnessInterior, ( lerp( AdaptationBrightnessNight, AdaptationBrightnessDay, hnd ) ), ji );
float AdaptationFactor = lerp( AdaptationFactorInterior, ( lerp( AdaptationFactorNight, AdaptationFactorDay, hnd ) ), ji );

float toobright = max(0,tex2D(_s2, _v0).xyz - AdaptationBrightness); // 0.1 = Dark, 0.35 = Normal lighting, 0.5 = Bright lighting
color.xyz *= 1-(AdaptationFactor * toobright); // 1.3
#else
float toobright = max(0,tex2D(_s2, _v0).xyz - 0.3); // 0.1 = Dark, 0.35 = Normal lighting, 0.5 = Bright lighting
color.xyz *= 1-(1 * toobright); // 1.3
#endif

and I changed some vars above.... shame on me. Restoring my previous effect.fx, no differences from 0.186 to 0.188 now.
Next time I'll think before talking.

One question coz I'm lazy : is it possible to add RGB tints (overall or per passes) in the enbsunsprite.fx ?
_________________
Lian Li PC011 Dynamic, Corsair AX 1500i PSU, i9 10850K @5.0 Ghz, Aorus Z490 Ultra, RTX3090 MSI Gaming X Trio, 32GB Corsair Vengeance Pro RGB RAM@3600, Corsair MP600 1TB NVME System Drive, 10 TB Storage, W10 Pro 64, Custom Hard Tubing Watercooling Loop

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17559
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: TES Skyrim 0.188

Don't know what do you mean rgb tints. Color filter as multiplier? Aren't they exist in shader or texture can do this?
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
User avatar
*blah-blah-blah maniac*
Posts: 1498
Joined: 31 Mar 2012, 15:06
Location: France

Re: TES Skyrim 0.188

I mean adding RGB vars in order to set color of the lenz.
I don't know if it's doable for ALL lenz (define in ProcessPass only and apply to entire Draw), or if it can be for each pass, set in techniques as offsets.
Could be great to define colors of lenz individually...
Do we need " ColorWriteEnable = ALPHA|RED|GREEN|BLUE; " in passes of technique for this ?
_________________
Lian Li PC011 Dynamic, Corsair AX 1500i PSU, i9 10850K @5.0 Ghz, Aorus Z490 Ultra, RTX3090 MSI Gaming X Trio, 32GB Corsair Vengeance Pro RGB RAM@3600, Corsair MP600 1TB NVME System Drive, 10 TB Storage, W10 Pro 64, Custom Hard Tubing Watercooling Loop

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

Re: TES Skyrim 0.188

ENBSeries wrote:Fake ssao combined with blurred image for shadowing isn't hard task, depth data available, multipasses for blurred image of darkness also.
I don't like contrast, because it use invalid math from some other universe, much better for hdr data to make separate computations for color and luma, apply "contrast" and then restore colors, no issues with intensity. It's like to shoot black-white photos on celluloid and then "print" them in laboratory (can't explain with my knowledge of engrish), you can make night the same as day or day as night if experienced enough photographer.
agreed, it's always more correct mathematically to compute all color in HDR. contrast is more like a cheat on pixel level, like fixing image with photoshop rather than shooting a photo with correct angle and lighting. but it's a simple and cheap way to enhance image without setting up lighting for the entire scene.

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17559
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: TES Skyrim 0.188

Oyama
ColorWriteEnable = ALPHA|RED|GREEN|BLUE or at least ColorWriteEnable = RED|GREEN|BLUE must be set to guarantee proper work in all cases.
Look at VS_Draw in each technique, it have input variables, the same can be used as rgb color, but for pixel shader function input.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
User avatar
*blah-blah-blah maniac*
Posts: 1498
Joined: 31 Mar 2012, 15:06
Location: France

Re: TES Skyrim 0.188

ENBSeries wrote:Oyama
ColorWriteEnable = ALPHA|RED|GREEN|BLUE or at least ColorWriteEnable = RED|GREEN|BLUE must be set to guarantee proper work in all cases.
Look at VS_Draw in each technique, it have input variables, the same can be used as rgb color, but for pixel shader function input.
Got it. On my way. Thanx Boris.
_________________
Lian Li PC011 Dynamic, Corsair AX 1500i PSU, i9 10850K @5.0 Ghz, Aorus Z490 Ultra, RTX3090 MSI Gaming X Trio, 32GB Corsair Vengeance Pro RGB RAM@3600, Corsair MP600 1TB NVME System Drive, 10 TB Storage, W10 Pro 64, Custom Hard Tubing Watercooling Loop

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

Re: TES Skyrim 0.188

far327;

Just add for example * tempF2 after the command you want to have adjustable in-game, you can download my beginner enbeffect.fx for examples on how to set up in-game adjustment.
Post Reply