Skip to content

Commit b24d21d

Browse files
committed
Sky: Darker, bluer sky and improved horizon haze at night
Add new colours 'skycolour_bright_night', 'bgcolour_bright_night' and enable these between sunset end and sunrise start Night sky has same hue as day sky but is darker and more saturated Night horizon haze (bgcolour) is slightly less saturated and slightly brighter than night sky, to be consistent with daytime horizon haze
1 parent 3ef71ed commit b24d21d

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/sky.cpp

+16-4
Original file line numberDiff line numberDiff line change
@@ -510,11 +510,15 @@ void Sky::update(float time_of_day, float time_brightness,
510510
//video::SColorf bgcolor_bright_dawn_f(0.666*1.2,0.549*1.0,0.220*1.2,1.0);
511511
video::SColorf bgcolor_bright_dawn_f
512512
(155./255*1.2,193./255,240./255, 1.0);
513+
video::SColorf bgcolor_bright_night_f
514+
(64./255, 144./255, 255./255, 1.0);
513515

514516
video::SColorf skycolor_bright_normal_f =
515517
video::SColor(255, 140, 186, 250);
516518
video::SColorf skycolor_bright_dawn_f =
517519
video::SColor(255, 180, 186, 250);
520+
video::SColorf skycolor_bright_night_f =
521+
video::SColor(255, 0, 107, 255);
518522

519523
video::SColorf cloudcolor_bright_normal_f =
520524
video::SColor(255, 240,240,255);
@@ -550,10 +554,18 @@ void Sky::update(float time_of_day, float time_brightness,
550554
m_cloudcolor_bright_f = m_cloudcolor_bright_f.getInterpolated(
551555
cloudcolor_bright_dawn_f, color_change_fraction);
552556
} else {
553-
m_bgcolor_bright_f = m_bgcolor_bright_f.getInterpolated(
554-
bgcolor_bright_normal_f, color_change_fraction);
555-
m_skycolor_bright_f = m_skycolor_bright_f.getInterpolated(
556-
skycolor_bright_normal_f, color_change_fraction);
557+
if (time_brightness < 0.07) { // Night sky
558+
m_bgcolor_bright_f = m_bgcolor_bright_f.getInterpolated(
559+
bgcolor_bright_night_f, color_change_fraction);
560+
m_skycolor_bright_f = m_skycolor_bright_f.getInterpolated(
561+
skycolor_bright_night_f, color_change_fraction);
562+
} else { // Daytime sky
563+
m_bgcolor_bright_f = m_bgcolor_bright_f.getInterpolated(
564+
bgcolor_bright_normal_f, color_change_fraction);
565+
m_skycolor_bright_f = m_skycolor_bright_f.getInterpolated(
566+
skycolor_bright_normal_f, color_change_fraction);
567+
}
568+
557569
m_cloudcolor_bright_f = m_cloudcolor_bright_f.getInterpolated(
558570
cloudcolor_bright_normal_f, color_change_fraction);
559571
}

0 commit comments

Comments
 (0)