From: Mikko Rasa Date: Fri, 17 Apr 2015 23:44:59 +0000 (+0300) Subject: Use skylight for nicer lighting X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=aa2c48c635ad0be4eb465a72861a8d5403647b0a;p=r2c2.git Use skylight for nicer lighting --- diff --git a/data/r2c2/default.shader b/data/r2c2/default.shader index 630d107..d417c9c 100644 --- a/data/r2c2/default.shader +++ b/data/r2c2/default.shader @@ -1,6 +1,8 @@ standard { lighting true; + specular true; + skylight true; material true; texture true; shadow true; diff --git a/data/r2c2/terrain.shader b/data/r2c2/terrain.shader index a425235..09c9867 100644 --- a/data/r2c2/terrain.shader +++ b/data/r2c2/terrain.shader @@ -1,6 +1,7 @@ standard { lighting true; + skylight true; material true; shadow true; }; diff --git a/data/r2c2/white.mat b/data/r2c2/white.mat index 191a222..688b863 100644 --- a/data/r2c2/white.mat +++ b/data/r2c2/white.mat @@ -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; diff --git a/source/3d/layout.cpp b/source/3d/layout.cpp index 19b59ee..74eaea3 100644 --- a/source/3d/layout.cpp +++ b/source/3d/layout.cpp @@ -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::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)