]> git.mxchange.org Git - flightgear.git/commitdiff
Model the effect where the sun and moon look 1.5 times larger when close to the horizon
authorehofman <ehofman>
Sun, 15 Jun 2003 12:23:55 +0000 (12:23 +0000)
committerehofman <ehofman>
Sun, 15 Jun 2003 12:23:55 +0000 (12:23 +0000)
src/Main/main.cxx

index c1d2ab2b71510c960465a2d91d127e14597ffcad..79fe01a9afe466b167971e213fb85850f04cee88 100644 (file)
@@ -624,6 +624,8 @@ void fgRenderFrame() {
             // within the range of the far clip plane.
             // Moon distance:    384,467 kilometers
             // Sun distance: 150,000,000 kilometers
+            double sun_eye_eff = 0.67+pow(0.5+cos(cur_light_params.sun_angle*2)/2,0.33)/3;
+            double moon_eye_eff = 0.67+pow(0.5+cos(cur_light_params.moon_angle*2)/2,0.33)/3;
             thesky->reposition( current__view->get_view_pos(),
                                 current__view->get_zero_elev(),
                                 current__view->get_world_up(),
@@ -637,10 +639,10 @@ void fgRenderFrame() {
                                 globals->get_time_params()->getGst(),
                                 globals->get_ephem()->getSunRightAscension(),
                                 globals->get_ephem()->getSunDeclination(),
-                                50000.0,
+                                50000.0 * sun_eye_eff,
                                 globals->get_ephem()->getMoonRightAscension(),
                                 globals->get_ephem()->getMoonDeclination(),
-                                40000.0 );
+                                40000.0 * moon_eye_eff );
         }
 
         glEnable( GL_DEPTH_TEST );