]> git.tdb.fi Git - libs/gl.git/blobdiff - source/materials/unlitmaterial.cpp
Adjust uniform organization for UnlitMaterial
[libs/gl.git] / source / materials / unlitmaterial.cpp
index 9aded2522972250cc76b1efcc3b0a745916b4461..e81be8ae136c3b8a915ef3b440b4c6946ffd5cb0 100644 (file)
@@ -9,7 +9,7 @@ UnlitMaterial::UnlitMaterial():
        texture(0),
        vertex_color(false)
 {
-       set_tint(Color(1.0f));
+       set_color(Color(1.0f));
 }
 
 void UnlitMaterial::fill_program_info(string &module_name, map<string, int> &spec_values) const
@@ -21,7 +21,7 @@ void UnlitMaterial::fill_program_info(string &module_name, map<string, int> &spe
 
 void UnlitMaterial::attach_textures_to(Texturing &texturing, ProgramData &tex_shdata) const
 {
-       attach_texture_to(texture, texturing, tex_shdata, "texture");
+       attach_texture_to(texture, texturing, tex_shdata, "color_tex");
 }
 
 void UnlitMaterial::set_texture(const Texture *tex)
@@ -29,10 +29,10 @@ void UnlitMaterial::set_texture(const Texture *tex)
        texture = tex;
 }
 
-void UnlitMaterial::set_tint(const Color &t)
+void UnlitMaterial::set_color(const Color &c)
 {
-       tint = t;
-       shdata.uniform("tint", tint);
+       color = c;
+       shdata.uniform("unlit_material.color", color);
 }
 
 void UnlitMaterial::set_vertex_color(bool vc)
@@ -59,7 +59,7 @@ void UnlitMaterial::Loader::init_actions()
 {
        Material::PropertyLoader<UnlitMaterial>::init_actions();
        add("texture", &Loader::property_texture, &UnlitMaterial::set_texture);
-       add_property("tint", &UnlitMaterial::set_tint, 0, true);
+       add_property("color", &UnlitMaterial::set_color, 0, true);
        add("vertex_color", &UnlitMaterial::vertex_color);
 }