]> git.mxchange.org Git - flightgear.git/commitdiff
Average sunlight and ambient light instead of multiplying it
authorehofman <ehofman>
Fri, 29 Aug 2003 22:13:05 +0000 (22:13 +0000)
committerehofman <ehofman>
Fri, 29 Aug 2003 22:13:05 +0000 (22:13 +0000)
src/Time/light.cxx

index 6dca0d6fd2c78ec78dfd35122adc35130a2c7e3d..43b97a01e927f266c24e4eb51a32b730e86e01c4 100644 (file)
@@ -160,13 +160,12 @@ void fgLIGHT::Update( void ) {
     if (fgGetBool("/test/scene_lighting")) {
         float *sun_color = thesky->get_sun_color();
 
-        // scene_ambient[0] = (sun_color[0]*0.1 + cloud_color[0]*0.9) * ambient;
-        // scene_ambient[1] = (sun_color[1]*0.1 + cloud_color[1]*0.9) * ambient;
-        // scene_ambient[2] = (sun_color[2]*0.1 + cloud_color[2]*0.9) * ambient;
-        // scene_ambient[3] = 1.5;
-        scene_ambient[0] = white[0] * ambient;
-        scene_ambient[1] = white[0] * ambient;
-        scene_ambient[2] = white[0] * ambient;
+        scene_ambient[0] = ((sun_color[0]*0.25 + cloud_color[0]*0.75) + ambient) / 2;
+        scene_ambient[1] = ((sun_color[1]*0.25 + cloud_color[1]*0.75) + ambient) / 2;
+        scene_ambient[2] = ((sun_color[2]*0.25 + cloud_color[2]*0.75) + ambient) / 2;
+        // scene_ambient[0] = white[0] * ambient;
+        // scene_ambient[1] = white[0] * ambient;
+        // scene_ambient[2] = white[0] * ambient;
         scene_ambient[3] = 1.0;
 
         scene_diffuse[0] = (sun_color[0]*0.25 + fog_color[0]*0.75) * diffuse;