-const Program *Material::create_compatible_shader(DataFile::Collection &coll) const
-{
- string source = create_program_source();
- string name = format("_material_%016x.glsl", hash64(source));
- Program *shprog = coll.find<Program>(name);
+ for(map<string, int>::const_iterator i=extra_spec.begin(); i!=extra_spec.end(); ++i)
+ spec_values[i->first] = i->second;
+
+ string info = module_name;
+ for(map<string, int>::const_iterator i=spec_values.begin(); i!=spec_values.end(); ++i)
+ info += format(",%s:%d", i->first, i->second);
+
+ Resources &res = Resources::get_global();
+ string name = format("_material_%016x.shader", hash64(info));
+ Program *shprog = res.find<Program>(name);