]> git.mxchange.org Git - flightgear.git/commitdiff
- The latest volley in the FlightGear lighting wars.
authorcurt <curt>
Fri, 29 Aug 2003 21:24:13 +0000 (21:24 +0000)
committercurt <curt>
Fri, 29 Aug 2003 21:24:13 +0000 (21:24 +0000)
- Ambient is based off the lookup table only.
- Diffuse is based off of the lookup table, but multiplied by a combination
  of sun/fog colors.

The result is a bit more ambient light at dusk and night since the world is
never 100% dark.  And we still get nice sunset/sunrise colored illumination
of surfaces that are directly illuminated by the sun.

src/Time/light.cxx

index 88000aee1a2af5946c43d81887735d0e45a148ce..6dca0d6fd2c78ec78dfd35122adc35130a2c7e3d 100644 (file)
@@ -160,15 +160,19 @@ 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] = (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[3] = 1.0;
 
         scene_diffuse[0] = (sun_color[0]*0.25 + fog_color[0]*0.75) * diffuse;
         scene_diffuse[1] = (sun_color[1]*0.25 + fog_color[1]*0.75) * diffuse;
         scene_diffuse[2] = (sun_color[2]*0.25 + fog_color[2]*0.75) * diffuse;
-        scene_diffuse[3] = 1.5;
+        scene_diffuse[3] = 1.0;
 
         scene_specular[0] = sun_color[0] * specular;
         scene_specular[1] = sun_color[1] * specular;