#include <stdexcept>
+#include <msp/gl/extensions/msp_legacy_features.h>
#include "error.h"
#include "light.h"
#include "lighting.h"
{
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; i<lights.size(); ++i)
void Lighting::bind() const
{
+ static Require _req(MSP_legacy_features);
if(lights.size()>LightUnit::get_n_units())
throw invalid_operation("Lighting::bind");