X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Flayout.cpp;h=74eaea32b07a5f3991c322ff1c5ba44ae1562a58;hb=aa2c48c635ad0be4eb465a72861a8d5403647b0a;hp=f30e427db65d21a81287406c534748f13d46af85;hpb=f4a19753515517e39cb61bd2447bae288d6e6a40;p=r2c2.git diff --git a/source/3d/layout.cpp b/source/3d/layout.cpp index f30e427..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)); @@ -196,9 +198,9 @@ void Layout3D::tick() Transform::rotation(Angle::half_turn()-time_of_day, Vector(0, 0, 1))* Transform::rotation(axial_tilt, Vector(-1, 0, 0)); Vector sun_dir = trans.transform_linear(Vector(0, -1, 0)); - Vector diff = Vector(sun.get_position())-sun_dir; + Vector diff = sun.get_position().slice<3>(0)-sun_dir; if(diff.norm()>0.0025f) - sun.set_position(GL::Vector4(sun_dir, 0.0f)); + sun.set_position(compose(sun_dir, 0.0f)); double T = 5777; double h = 6.62606957e-34; // Planck constant @@ -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)