X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flighting.cpp;h=239bdc19d0d03fdb9d0bcfaf58902d4c12abf4f6;hb=50a0c7fd661fe6bfa3f929ad66e47cfab4a0fb87;hp=7f662c72d9ccf55bdb0e5e8831706b9781709360;hpb=9fff9eb832db3b64416ae49bbdc826f33e3ceb19;p=libs%2Fgl.git diff --git a/source/lighting.cpp b/source/lighting.cpp index 7f662c72..239bdc19 100644 --- a/source/lighting.cpp +++ b/source/lighting.cpp @@ -1,4 +1,5 @@ #include +#include #include "error.h" #include "light.h" #include "lighting.h" @@ -61,7 +62,7 @@ void Lighting::update_shader_data(ProgramData &shdata, const Matrix &view_matrix { shdata.uniform("ambient_color", ambient); shdata.uniform("sky_color", sky_color); - shdata.uniform("eye_sky_dir", Vector3(view_matrix*Vector4(sky_direction, 0.0f))); + shdata.uniform("eye_sky_dir", view_matrix.block<3, 3>(0, 0)*sky_direction); shdata.uniform("horizon_limit", horizon_angle.radians()); for(unsigned i=0; iLightUnit::get_n_units()) throw invalid_operation("Lighting::bind");