]> git.mxchange.org Git - flightgear.git/commitdiff
Darken the clouds near sunrise/sunset
authorehofman <ehofman>
Fri, 16 May 2003 17:35:48 +0000 (17:35 +0000)
committerehofman <ehofman>
Fri, 16 May 2003 17:35:48 +0000 (17:35 +0000)
src/Time/light.cxx

index 1e3a15d722795c6628b80acee766ca45790c6063..b635f37ac79dff58d45f31298195ef864a5a1901 100644 (file)
@@ -173,6 +173,14 @@ void fgLIGHT::Update( void ) {
     fog_color[1] = cloud_color[1] * (0.48 + sun_color[1]/1.923);  //  40% green
     fog_color[2] = cloud_color[2] * sun_color[2];                 //   0% blue
     fog_color[3] = cloud_color[3];
+
+    // update the cloud colors for sunrise/sunset effects (darken them)
+    if (sun_angle > 1.0) {
+       float sun_2x = sqrt(sun_angle);
+       cloud_color[0] /= sun_2x;
+       cloud_color[1] /= sun_2x;
+       cloud_color[2] /= sun_2x;
+    }
 }