1 #include "unlitmaterial.h"
8 UnlitMaterial::UnlitMaterial():
12 set_color(Color(1.0f));
15 void UnlitMaterial::fill_program_info(string &module_name, map<string, int> &spec_values) const
17 module_name = "unlit.glsl";
18 spec_values["use_texture"] = (texture!=0);
19 spec_values["use_vertex_color"] = vertex_color;
22 void UnlitMaterial::attach_textures_to(Texturing &texturing, ProgramData &tex_shdata) const
24 attach_texture_to(texture, texturing, tex_shdata, "color_tex");
27 void UnlitMaterial::set_texture(const Texture *tex)
32 void UnlitMaterial::set_color(const Color &c)
35 shdata.uniform("unlit_material.color", color);
38 void UnlitMaterial::set_vertex_color(bool vc)
44 DataFile::Loader::ActionMap UnlitMaterial::Loader::shared_actions;
46 UnlitMaterial::Loader::Loader(UnlitMaterial &m):
47 DerivedObjectLoader<UnlitMaterial, Material::PropertyLoader<UnlitMaterial> >(m)
49 set_actions(shared_actions);
52 UnlitMaterial::Loader::Loader(UnlitMaterial &m, Collection &c):
53 DerivedObjectLoader<UnlitMaterial, Material::PropertyLoader<UnlitMaterial> >(m, c)
55 set_actions(shared_actions);
58 void UnlitMaterial::Loader::init_actions()
60 Material::PropertyLoader<UnlitMaterial>::init_actions();
61 add("texture", &Loader::property_texture, &UnlitMaterial::set_texture);
62 add_property("color", &UnlitMaterial::set_color, 0, true);
63 add("vertex_color", &UnlitMaterial::vertex_color);