namespace Msp {
namespace GL {
-BasicMaterial::BasicMaterial()
+BasicMaterial::BasicMaterial():
+ receive_shadows(false)
{
set_diffuse(Color(1.0f));
set_specular(Color(0.0f));
if (reflectivity.texture)
source += "const bool use_reflectivity_map = true;\n";
}
+ if(receive_shadows)
+ source += "const bool use_shadow_map = true;\n";
return source;
}
reflectivity.texture = tex;
}
+void BasicMaterial::set_receive_shadows(bool s)
+{
+ receive_shadows = s;
+}
+
DataFile::Loader::ActionMap BasicMaterial::Loader::shared_actions;
add_property("emission", &BasicMaterial::set_emission, &BasicMaterial::set_emission_map, false);
add_property("shininess", &BasicMaterial::set_shininess, &BasicMaterial::set_shininess_map);
add_property("reflectivity", &BasicMaterial::set_reflectivity, &BasicMaterial::set_reflectivity_map);
+ add("receive_shadows", &BasicMaterial::receive_shadows);
}
} // namespace GL
Property<Vector3> normal;
Property<Color> emission;
Property<float> reflectivity;
+ bool receive_shadows;
public:
BasicMaterial();
void set_shininess_map(const Texture *);
void set_reflectivity(float);
void set_reflectivity_map(const Texture *);
+ void set_receive_shadows(bool);
};
} // namespace GL