namespace Msp {
namespace GL {
+const Tag BasicMaterial::texture_tags[] =
+{
+ Tag("diffuse_map"),
+ Tag("specular_map"),
+ Tag("shininess_map"),
+ Tag("normal_map"),
+ Tag("emission_map"),
+ Tag("reflectivity_map"),
+ Tag()
+};
+
BasicMaterial::BasicMaterial():
receive_shadows(false)
{
spec_values["use_shadow_map"] = receive_shadows;
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
void BasicMaterial::attach_textures_to(Texturing &texturing, ProgramData &tex_shdata) const
{
attach_texture_to(diffuse.texture, texturing, tex_shdata, "diffuse_map");
attach_texture_to(shininess.texture, texturing, tex_shdata, "shininess_map");
attach_texture_to(reflectivity.texture, texturing, tex_shdata, "reflectivity_map");
}
+#pragma GCC diagnostic pop
+
+const Texture *BasicMaterial::get_texture(Tag tag) const
+{
+ if(tag==texture_tags[0])
+ return diffuse.texture;
+ else if(tag==texture_tags[1])
+ return specular.texture;
+ else if(tag==texture_tags[2])
+ return shininess.texture;
+ else if(tag==texture_tags[3])
+ return normal.texture;
+ else if(tag==texture_tags[4])
+ return emission.texture;
+ else if(tag==texture_tags[5])
+ return reflectivity.texture;
+ else
+ return 0;
+}
void BasicMaterial::set_diffuse(const Color &color)
{