diff options
author | paramat <mat.gregory@virginmedia.com> | 2016-05-25 00:56:49 +0100 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2016-06-09 01:50:52 +0100 |
commit | b24d21d1ae25c377e14223ee20d9de9158fe916c (patch) | |
tree | ef200cb0cde086a08b3fb9068d8816864b09cdc2 | |
parent | 3ef71edd818b15ed2ba2f184b8a2dc4ee6198042 (diff) | |
download | minetest-b24d21d1ae25c377e14223ee20d9de9158fe916c.tar.gz minetest-b24d21d1ae25c377e14223ee20d9de9158fe916c.tar.bz2 minetest-b24d21d1ae25c377e14223ee20d9de9158fe916c.zip |
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
-rw-r--r-- | src/sky.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/sky.cpp b/src/sky.cpp index 4ee750c55..7757120bf 100644 --- a/src/sky.cpp +++ b/src/sky.cpp @@ -510,11 +510,15 @@ void Sky::update(float time_of_day, float time_brightness, //video::SColorf bgcolor_bright_dawn_f(0.666*1.2,0.549*1.0,0.220*1.2,1.0); video::SColorf bgcolor_bright_dawn_f (155./255*1.2,193./255,240./255, 1.0); + video::SColorf bgcolor_bright_night_f + (64./255, 144./255, 255./255, 1.0); video::SColorf skycolor_bright_normal_f = video::SColor(255, 140, 186, 250); video::SColorf skycolor_bright_dawn_f = video::SColor(255, 180, 186, 250); + video::SColorf skycolor_bright_night_f = + video::SColor(255, 0, 107, 255); video::SColorf cloudcolor_bright_normal_f = video::SColor(255, 240,240,255); @@ -550,10 +554,18 @@ void Sky::update(float time_of_day, float time_brightness, m_cloudcolor_bright_f = m_cloudcolor_bright_f.getInterpolated( cloudcolor_bright_dawn_f, color_change_fraction); } else { - m_bgcolor_bright_f = m_bgcolor_bright_f.getInterpolated( - bgcolor_bright_normal_f, color_change_fraction); - m_skycolor_bright_f = m_skycolor_bright_f.getInterpolated( - skycolor_bright_normal_f, color_change_fraction); + if (time_brightness < 0.07) { // Night sky + m_bgcolor_bright_f = m_bgcolor_bright_f.getInterpolated( + bgcolor_bright_night_f, color_change_fraction); + m_skycolor_bright_f = m_skycolor_bright_f.getInterpolated( + skycolor_bright_night_f, color_change_fraction); + } else { // Daytime sky + m_bgcolor_bright_f = m_bgcolor_bright_f.getInterpolated( + bgcolor_bright_normal_f, color_change_fraction); + m_skycolor_bright_f = m_skycolor_bright_f.getInterpolated( + skycolor_bright_normal_f, color_change_fraction); + } + m_cloudcolor_bright_f = m_cloudcolor_bright_f.getInterpolated( cloudcolor_bright_normal_f, color_change_fraction); } |