- if(obj.shdata)
- {
- for(unsigned i=0; i<textures.size(); ++i)
- obj.shdata->uniform(obj.shprog->get_uniform_location(textures[i]), static_cast<int>(i));
- }
+ for(map<unsigned, ObjectPass>::iterator i=obj.passes.begin(); i!=obj.passes.end(); ++i)
+ if(i->second.shdata)
+ {
+ for(unsigned j=0; j<textures.size(); ++j)
+ i->second.shdata->uniform(i->second.shprog->get_uniform_location(textures[j]), static_cast<int>(j));
+ }
+}
+
+void Object::Loader::lod_mesh(unsigned l, const string &n)
+{
+ obj.meshes.resize(l+1, 0);
+ obj.meshes[l]=coll.get<Mesh>(n);
+}
+
+void Object::Loader::material_inline()
+{
+ RefPtr<Material> mat=new Material;
+ load_sub(*mat);
+ coll.add(format("%p%p", &obj, mat.get()), mat.get());
+ obj.material=mat.release();
+}
+
+void Object::Loader::mesh(const string &n)
+{
+ obj.meshes[0]=coll.get<Mesh>(n);
+}
+
+void Object::Loader::pass(const string &n)
+{
+ unsigned id=Tag(n).id;
+ if(obj.passes.count(id))
+ throw KeyError("Duplicate pass name");
+ ObjectPass p;
+ load_sub(p, coll);
+ obj.passes[id]=p;