From 13fab25b6f06e226271da0e958fb3f6e65014a16 Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Tue, 1 Feb 2022 16:23:07 +0000 Subject: [PATCH] MR273 - Added the Milky Way onto the night sky from Chris RINGEVAL https://sourceforge.net/p/flightgear/flightgear/merge-requests/273/ Squashed commit of the following: commit ea6e808e418533db1a41671c67a7873ddbfcc858 Author: Gonzalo Pesquero Date: Sun Nov 21 17:44:44 2021 +0100 Add translations on splash screen commit 3c47d771877743692f5d0d63e980d6694a549405 Author: Chris Ringeval Date: Sat Nov 27 16:37:31 2021 +0100 Moon direction vector in the eye frame available to shaders commit 70728f7ea29dad75c34cad69745021ee927bea31 Author: Chris Ringeval Date: Sun Nov 21 22:18:38 2021 +0100 Add altitude to scolor object as needed by Milky Way texturing --- src/Viewer/renderer.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Viewer/renderer.cxx b/src/Viewer/renderer.cxx index 7042a414b..807a62fbe 100644 --- a/src/Viewer/renderer.cxx +++ b/src/Viewer/renderer.cxx @@ -851,8 +851,10 @@ FGRenderer::update( ) { _updateVisitor->setViewData(current__view->getViewPosition(), current__view->getViewOrientation()); //_updateVisitor->setViewData(eye2, center3); - SGVec3f direction(l->sun_vec()[0], l->sun_vec()[1], l->sun_vec()[2]); - _updateVisitor->setLight(direction, l->scene_ambient(), + SGVec3f sundirection(l->sun_vec()[0], l->sun_vec()[1], l->sun_vec()[2]); + SGVec3f moondirection(l->moon_vec()[0], l->moon_vec()[1], l->moon_vec()[2]); + + _updateVisitor->setLight(sundirection,moondirection, l->scene_ambient(), l->scene_diffuse(), l->scene_specular(), l->adj_fog_color(), l->get_sun_angle()*SGD_RADIANS_TO_DEGREES); @@ -901,7 +903,8 @@ FGRenderer::updateSky() scolor.cloud_color = SGVec3f(l->cloud_color().data()); scolor.sun_angle = l->get_sun_angle(); scolor.moon_angle = l->get_moon_angle(); - + scolor.altitude_m = altitude_m; + Ephemeris* ephemerisSub = globals->get_subsystem(); double delta_time_sec = _sim_delta_sec->getDoubleValue(); _sky->reposition( sstate, *ephemerisSub->data(), delta_time_sec );