]> git.tdb.fi Git - r2c2.git/commitdiff
Use skylight for nicer lighting
authorMikko Rasa <tdb@tdb.fi>
Fri, 17 Apr 2015 23:44:59 +0000 (02:44 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 17 Apr 2015 23:44:59 +0000 (02:44 +0300)
data/r2c2/default.shader
data/r2c2/terrain.shader
data/r2c2/white.mat
source/3d/layout.cpp

index 630d107076c2cb0e846ab9a591347d599e379352..d417c9c3df59bb39b18cbb96501626ee359fcd3f 100644 (file)
@@ -1,6 +1,8 @@
 standard
 {
        lighting true;
+       specular true;
+       skylight true;
        material true;
        texture true;
        shadow true;
index a425235e57f9e4115d2166140b5a2415354d9634..09c98672c1fcf01484753dd0a751edc132d95e79 100644 (file)
@@ -1,6 +1,7 @@
 standard
 {
        lighting true;
+       skylight true;
        material true;
        shadow true;
 };
index 191a222d29f20a542de0c36039544f6aae76a5cc..688b86340d554c8bf4458a04b9b93b5835d97e95 100644 (file)
@@ -1,4 +1,4 @@
 diffuse 1.0 1.0 1.0 1.0;
 ambient 1.0 1.0 1.0 1.0;
-specular 0.25 0.25 0.25 1.0;
+specular 0.3 0.3 0.3 1.0;
 shininess 100;
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)