+void Object::render(Renderer &renderer, const ObjectInstance &inst, const Tag &tag) const
+{
+ const RenderPass *pass = get_pass(tag);
+ if(!pass)
+ return;
+
+ Renderer::Push push(renderer);
+ renderer.set_shader_program(pass->get_shader_program(), pass->get_shader_data());
+ renderer.set_material(pass->get_material());
+ renderer.set_texturing(pass->get_texturing());
+
+ inst.setup_render(renderer, tag);
+ unsigned lod = min<unsigned>(inst.get_level_of_detail(renderer), meshes.size()-1);
+ meshes[lod]->draw(renderer);
+ inst.finish_render(renderer, tag);