Just wrote this out of the top of my head, not tested but should work...
Code: Select all
#define SUNRISESET 0.5 //Where in ENightDayFactor is Sunrise/Set event
#define SUNRISESET_DURATION 0.1 //Total duration of the event
#define COLOR_NIGHT float3(0, 0, 0)
#define COLOR_SUNRISESET float3(1, 0, 0)
#define COLOR_DAY float3(1, 1, 1)
//IF NIGHT
if (ENightDayFactor < SUNRISESET - 0.5 * SUNRISESET_DURATION)
color.rgb = COLOR_NIGHT;
//TRANSITION NIGHT - SUNRISE/SUNSET
else if (ENightDayFactor >= SUNRISESET - 0.5 * SUNRISESET_DURATION && ENightDayFactor < SUNRISESET)
color.rgb = lerp( COLOR_NIGHT, COLOR_SUNRISESET, smoothstep( SUNRISESET - 0.5 * SUNRISESET_DURATION, SUNRISESET, ENightDayFactor ));
//TRANSITION SUNRISE/SUNSET - DAY
else if (ENightDayFactor >= SUNRISESET && ENightDayFactor <= SUNRISESET + 0.5 * SUNRISESET_DURATION)
color.rgb = lerp( COLOR_SUNRISESET, COLOR_DAY, smoothstep( SUNRISESET, SUNRISESET + 0.5 * SUNRISESET_DURATION, ENightDayFactor ));
//IF DAY
else if (ENightDayFactor > SUNRISESET + 0.5 * SUNRISESET_DURATION)
color.rgb = COLOR_DAY;
But this will assume ENightDayFactor is tied to TIMEOFDAY [Min/Max values, not other?], which I think it is not. I believe ENB is using sun position to determine what to do, not game time. Anyway if TOD is actually linked to ENightDayFactor you need to set the ranges correctly so that the above code takes effect correctly, meaning exactly the same.
I didn't have much success to practically implementing this, too many variables try to play nice together. Its a hassle, I don't think worth it.
Edits: typo's in code