1 #include "unlitmaterial.h"
8 const Tag UnlitMaterial::texture_tags[] =
14 UnlitMaterial::UnlitMaterial()
16 set_color(Color(1.0f));
19 void UnlitMaterial::fill_program_info(string &module_name, map<string, int> &spec_values) const
21 module_name = "unlit.glsl";
22 spec_values["use_texture"] = (texture!=0);
23 spec_values["use_vertex_color"] = vertex_color;
26 const Texture *UnlitMaterial::get_texture(Tag tag) const
28 if(tag==texture_tags[0])
34 void UnlitMaterial::set_texture(const Texture *tex)
39 void UnlitMaterial::set_color(const Color &c)
42 shdata.uniform("unlit_material.color", color);
45 void UnlitMaterial::set_vertex_color(bool vc)
51 DataFile::Loader::ActionMap UnlitMaterial::Loader::shared_actions;
53 UnlitMaterial::Loader::Loader(UnlitMaterial &m, Collection &c):
54 DerivedObjectLoader<UnlitMaterial, Material::PropertyLoader<UnlitMaterial> >(m, c)
56 set_actions(shared_actions);
59 void UnlitMaterial::Loader::init_actions()
61 Material::PropertyLoader<UnlitMaterial>::init_actions();
62 add("texture", &Loader::property_texture, &UnlitMaterial::set_texture);
63 add_property("color", &UnlitMaterial::set_color, 0, true);
64 add("vertex_color", &UnlitMaterial::vertex_color);