shprog.keep();
}
else
- shprog = material->create_compatible_shader();
+ throw invalid_operation("no collection");
if(shdata)
shdata = new ProgramData(*shdata, shprog.get());
return i->second;
}
-void RenderPass::set_material(const Material *mat)
+void RenderPass::set_material(const Material *mat, DataFile::Collection *coll)
{
material = mat;
material.keep();
- finalize_material(0);
+ finalize_material(coll);
}
-void RenderPass::set_texture(unsigned index, const Texture *tex)
+void RenderPass::set_texture(unsigned index, const Texture *tex, const Sampler *samp)
{
if(!texturing)
texturing = new Texturing;
- texturing->attach(index, *tex, texturing->get_attached_sampler(index));
+ texturing->attach(index, *tex, (samp ? samp : texturing->get_attached_sampler(index)));
}
int RenderPass::get_texture_index(const string &n) const