From a315df50f8be005dc03f1a62b69d250a15ad16de Mon Sep 17 00:00:00 2001 From: ehofman Date: Sat, 2 Aug 2003 12:45:15 +0000 Subject: [PATCH] Update scene lighting --- src/Time/light.cxx | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/Time/light.cxx b/src/Time/light.cxx index 145df3926..43549db62 100644 --- a/src/Time/light.cxx +++ b/src/Time/light.cxx @@ -134,21 +134,6 @@ void fgLIGHT::Update( void ) { // if ( diffuse < 0.0 ) { diffuse = 0.0; } // if ( sky_brightness < 0.1 ) { sky_brightness = 0.1; } - scene_ambient[0] = white[0] * ambient; - scene_ambient[1] = white[1] * ambient; - scene_ambient[2] = white[2] * ambient; - scene_ambient[3] = 1.0; - - scene_diffuse[0] = white[0] * diffuse; - scene_diffuse[1] = white[1] * diffuse; - scene_diffuse[2] = white[2] * diffuse; - scene_diffuse[3] = 1.0; - - scene_specular[0] = white[0] * specular; - scene_specular[1] = white[1] * specular; - scene_specular[2] = white[2] * specular; - scene_specular[3] = 1.0; - // set sky color sky_color[0] = base_sky_color[0] * sky_brightness; sky_color[1] = base_sky_color[1] * sky_brightness; @@ -171,6 +156,23 @@ void fgLIGHT::Update( void ) { cloud_color[2] /= sun2; } gamma_correct_rgb( cloud_color ); + + float *sun_color = thesky->get_sun_color(); + + scene_ambient[0] = fog_color[0] * ambient; + scene_ambient[1] = fog_color[1] * ambient; + scene_ambient[2] = fog_color[2] * ambient; + scene_ambient[3] = 1.0; + + scene_diffuse[0] = fog_color[0] * diffuse; + scene_diffuse[1] = fog_color[1] * diffuse; + scene_diffuse[2] = fog_color[2] * diffuse; + scene_diffuse[3] = 1.0; + + scene_specular[0] = sun_color[0] * specular; + scene_specular[1] = sun_color[1] * specular; + scene_specular[2] = sun_color[2] * specular; + scene_specular[3] = 1.0; }