#include <simgear/math/interpolater.hxx>
#include <simgear/math/polar3d.hxx>
#include <simgear/misc/sg_path.hxx>
+#include <simgear/sky/sky.hxx>
#include <Aircraft/aircraft.hxx>
#include <Main/globals.hxx>
#include "light.hxx"
#include "sunpos.hxx"
+extern SGSky *thesky; // FIXME: from main.cxx
fgLIGHT cur_light_params;
// if the 4th field is 0.0, this specifies a direction ...
GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
// base sky color
- GLfloat base_sky_color[4] = { 0.60, 0.60, 0.90, 1.0 };
- // base fog color
- GLfloat base_fog_color[4] = { 0.90, 0.90, 1.00, 1.0 };
+#if defined (sgi) || defined( macintosh )
+ GLfloat base_sky_color[4] = { 0.252, 0.403, 0.657, 1.0 };
+#else // default
+ GLfloat base_sky_color[4] = { 0.336, 0.406, 0.574, 1.0 };
+#endif
+ GLfloat base_fog_color[4] = { 0.80, 0.83, 1.0, 1.0 };
double deg, ambient, diffuse, specular, sky_brightness;
f = current_aircraft.fdm_state;
// calculate lighting parameters based on sun's relative angle to
// local up
+ // base fog color
+ float *sun_color = thesky->get_sun_color();
+
+ base_fog_color[0] *= (1.25 - sun_color[0]/4.0); // 100% red
+ base_fog_color[1] *= (0.48 + sun_color[1]/1.923); // 40% green
+ base_fog_color[2] *= sun_color[2]; // 0% blue
+
+
deg = sun_angle * SGD_RADIANS_TO_DEGREES;
SG_LOG( SG_EVENT, SG_INFO, " Sun angle = " << deg );