@@ -433,9 +433,14 @@ void Sky::update(float time_of_day, float time_brightness,
433
433
// video::SColorf cloudcolor_bright_dawn_f(1.0, 0.65, 0.44);
434
434
video::SColorf cloudcolor_bright_dawn_f (1.0 , 0.7 , 0.5 );
435
435
436
+ float cloud_color_change_fraction = 0.95 ;
436
437
if (sunlight_seen){
437
- // m_brightness = m_brightness * 0.95 + direct_brightness * 0.05;
438
- m_brightness = m_brightness * 0.95 + time_brightness * 0.05 ;
438
+ if (fabs (time_brightness - m_brightness) < 0.2 ){
439
+ m_brightness = m_brightness * 0.95 + time_brightness * 0.05 ;
440
+ } else {
441
+ m_brightness = m_brightness * 0.80 + time_brightness * 0.20 ;
442
+ cloud_color_change_fraction = 0.0 ;
443
+ }
439
444
}
440
445
else {
441
446
if (direct_brightness < m_brightness)
@@ -493,8 +498,8 @@ void Sky::update(float time_of_day, float time_brightness,
493
498
} else {
494
499
cloud_direct_brightness = direct_brightness;
495
500
}
496
- m_cloud_brightness = m_cloud_brightness * 0.95 +
497
- cloud_direct_brightness * (1.0 - 0.95 );
501
+ m_cloud_brightness = m_cloud_brightness * cloud_color_change_fraction +
502
+ cloud_direct_brightness * (1.0 - cloud_color_change_fraction );
498
503
m_cloudcolor_f = video::SColorf (
499
504
m_cloudcolor_bright_f.getRed () * m_cloud_brightness,
500
505
m_cloudcolor_bright_f.getGreen () * m_cloud_brightness,
0 commit comments