1
0
Fork 0

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 <gpesquero@yahoo.es>
Date:   Sun Nov 21 17:44:44 2021 +0100

    Add translations on splash screen

commit 3c47d771877743692f5d0d63e980d6694a549405
Author: Chris Ringeval <eatdirt@protonmail.com>
Date:   Sat Nov 27 16:37:31 2021 +0100

    Moon direction vector in the eye frame available to shaders

commit 70728f7ea29dad75c34cad69745021ee927bea31
Author: Chris Ringeval <eatdirt@protonmail.com>
Date:   Sun Nov 21 22:18:38 2021 +0100

    Add altitude to scolor object as needed by Milky Way texturing
This commit is contained in:
Stuart Buchanan 2022-02-01 16:23:07 +00:00
parent 276835f74c
commit 13fab25b6f

View file

@ -851,8 +851,10 @@ FGRenderer::update( ) {
_updateVisitor->setViewData(current__view->getViewPosition(), _updateVisitor->setViewData(current__view->getViewPosition(),
current__view->getViewOrientation()); current__view->getViewOrientation());
//_updateVisitor->setViewData(eye2, center3); //_updateVisitor->setViewData(eye2, center3);
SGVec3f direction(l->sun_vec()[0], l->sun_vec()[1], l->sun_vec()[2]); SGVec3f sundirection(l->sun_vec()[0], l->sun_vec()[1], l->sun_vec()[2]);
_updateVisitor->setLight(direction, l->scene_ambient(), 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->scene_diffuse(), l->scene_specular(),
l->adj_fog_color(), l->adj_fog_color(),
l->get_sun_angle()*SGD_RADIANS_TO_DEGREES); l->get_sun_angle()*SGD_RADIANS_TO_DEGREES);
@ -901,7 +903,8 @@ FGRenderer::updateSky()
scolor.cloud_color = SGVec3f(l->cloud_color().data()); scolor.cloud_color = SGVec3f(l->cloud_color().data());
scolor.sun_angle = l->get_sun_angle(); scolor.sun_angle = l->get_sun_angle();
scolor.moon_angle = l->get_moon_angle(); scolor.moon_angle = l->get_moon_angle();
scolor.altitude_m = altitude_m;
Ephemeris* ephemerisSub = globals->get_subsystem<Ephemeris>(); Ephemeris* ephemerisSub = globals->get_subsystem<Ephemeris>();
double delta_time_sec = _sim_delta_sec->getDoubleValue(); double delta_time_sec = _sim_delta_sec->getDoubleValue();
_sky->reposition( sstate, *ephemerisSub->data(), delta_time_sec ); _sky->reposition( sstate, *ephemerisSub->data(), delta_time_sec );