mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
Night sky: Fix brightness threshold for applying night colours (#7859)
Previously, 'time_brightness' never fell below the threshold so night sky colours were not applied. Increase the threshold value. But now also set it to a value less sensitive to possible future small changes in 'time_brightness', by setting it halfway between the 'time_brightness' values for darkest night and first stage of dawn.
This commit is contained in:
parent
98ee08904b
commit
85b01eacd2
@ -610,7 +610,7 @@ void Sky::update(float time_of_day, float time_brightness,
|
||||
}
|
||||
|
||||
m_clouds_visible = true;
|
||||
float color_change_fraction = 0.98;
|
||||
float color_change_fraction = 0.98f;
|
||||
if (sunlight_seen) {
|
||||
if (is_dawn) { // Dawn
|
||||
m_bgcolor_bright_f = m_bgcolor_bright_f.getInterpolated(
|
||||
@ -620,7 +620,7 @@ 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 {
|
||||
if (time_brightness < 0.07) { // Night
|
||||
if (time_brightness < 0.13f) { // Night
|
||||
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(
|
||||
|
Loading…
Reference in New Issue
Block a user