void RenderMethod::set_material_textures()
{
+ if(!material)
+ return;
+
const Tag *material_texture_tags = material->get_texture_tags();
for(const Tag *tag=material_texture_tags; tag->id; ++tag)
set_texture(*tag, material->get_texture(*tag), material->get_sampler(*tag));
void RenderMethod::maybe_create_material_shader()
{
- if(shprog && !shprog_from_material)
+ if(!material || (shprog && !shprog_from_material))
return;
map<string, int> extra_spec;
shprog = prog;
shprog_from_material = false;
shdata = (data ? new ProgramData(*data) : 0);
+ maybe_create_material_shader();
}
Tag RenderMethod::get_slotted_uniform_tag(Tag slot) const
void RenderMethod::set_receive_shadows(bool rs)
{
receive_shadows = rs;
+ maybe_create_material_shader();
}
void RenderMethod::apply(Renderer &renderer) const