- technique = *tech;
- technique.replace_texture("diffuse_map", font.get_texture());
- object.set_technique(&technique);
+ if(!tex_slot.id && tech->has_pass(Tag()))
+ if(const Program *shprog = tech->get_pass(Tag()).get_shader_program())
+ {
+ if(shprog->get_uniform_location(Tag("font_tex"))>=0)
+ tex_slot = "font_tex";
+ else if(shprog->get_uniform_location(Tag("color_tex"))>=0)
+ tex_slot = "color_tex";
+ else if(shprog->get_uniform_location(Tag("diffuse_map"))>=0)
+ tex_slot = "diffuse_map";
+ else if(shprog->get_uniform_location(Tag("base_color_map"))>=0)
+ tex_slot = "base_color_map";
+ }
+
+ object.set_technique(tech);
+ texture_slot = tex_slot;