ENBSeries
http://enbdev.com/enbseries/forum/

enbpalette only at night?
http://enbdev.com/enbseries/forum/viewtopic.php?f=28&t=2603
Page 1 of 1

Author:  Wraithstrike [ 01 Dec 2013, 23:59 ]
Post subject:  enbpalette only at night?

I'm playing Oblivion and have found an enbpalette.bmp with a strong color shift that looks really cool at night. Problem is, in the daytime it stomps over the bright blue skies and green fields that give the Oblivion world much of its character.

Is there a way to make the enbpalette only get applied at night?

Author:  ENBSeries [ 02 Dec 2013, 00:14 ]
Post subject:  Re: enbpalette only at night?

Open enbeffect.fx file in any text editor, find line:
Code:
color.rgb=saturate(color.rgb);
float3   brightness=Adaptation.xyz;//tex2D(_s4, 0.5);//adaptation luminance

and insert between them the following:
Code:
float3 nopalcolor=color;

then find this line below:
Code:
color.rgb=palette.rgb;

and replace it by this one:
Code:
color.rgb=lerp(palette, nopalcolor, ENightDayFactor);


Entire palette code will look like this after such changes:
Code:
#ifdef E_CC_PALETTE
   color.rgb=saturate(color.rgb);
float3 nopalcolor=color;
   float3   brightness=Adaptation.xyz;//tex2D(_s4, 0.5);//adaptation luminance
//   brightness=saturate(brightness);//old version from ldr games
   brightness=(brightness/(brightness+1.0));//new version
   brightness=max(brightness.x, max(brightness.y, brightness.z));//new version
   float3   palette;
   float4   uvsrc=0.0;
   uvsrc.y=brightness.r;
   uvsrc.x=color.r;
   palette.r=tex2Dlod(_s7, uvsrc).r;
   uvsrc.x=color.g;
   uvsrc.y=brightness.g;
   palette.g=tex2Dlod(_s7, uvsrc).g;
   uvsrc.x=color.b;
   uvsrc.y=brightness.b;
   palette.b=tex2Dlod(_s7, uvsrc).b;
   //color.rgb=palette.rgb;
color.rgb=lerp(palette, nopalcolor, ENightDayFactor);
#endif //E_CC_PALETTE

Author:  Wraithstrike [ 02 Dec 2013, 09:04 ]
Post subject:  Re: enbpalette only at night?

That worked, thanks!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/