+Program *Material::create_compatible_shader() const
+{
+ return new Program(create_program_source());
+}
+
+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);
+ if(shprog)
+ return shprog;
+
+ shprog = new Program(create_program_source());
+ try
+ {
+ coll.add(name, shprog);
+ }
+ catch(...)
+ {
+ delete shprog;
+ throw;
+ }
+
+ return shprog;
+}
+