]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/layout.cpp
Use skylight for nicer lighting
[r2c2.git] / source / 3d / layout.cpp
index 19b59eee6bbf300cc63382749b13e0f564bf6b6f..74eaea32b07a5f3991c322ff1c5ba44ae1562a58 100644 (file)
@@ -144,6 +144,8 @@ Layout3D::Layout3D(Layout &l):
        sun.set_specular(GL::Color(0.0));
        lighting.set_ambient(GL::Color(0.2));
        lighting.attach(0, sun);
+       lighting.set_sky_color(GL::Color(0.2));
+       lighting.set_horizon_angle(Geometry::Angle<float>::from_degrees(5));
 
        layout.signal_object_added.connect(sigc::mem_fun(this, &Layout3D::object_added));
        layout.signal_object_removed.connect(sigc::mem_fun(this, &Layout3D::object_removed));
@@ -251,7 +253,8 @@ void Layout3D::tick()
                        }
 
        GL::Color skylight_color = spectrum_to_rgb(skylight_spectrum)*(2e-15/total_weight);
-       lighting.set_ambient(skylight_color*0.5);
+       lighting.set_sky_color(skylight_color*0.65);
+       lighting.set_ambient(skylight_color*0.35);
 }
 
 void Layout3D::object_added(Object &o)