shprog_from_material(false),
shdata(0),
material(0),
- back_faces(false)
+ back_faces(false),
+ receive_shadows(false)
{ }
void RenderPass::set_material_textures()
if(shprog && !shprog_from_material)
return;
+ map<string, int> extra_spec;
+ if(receive_shadows)
+ extra_spec["use_shadow_map"] = true;
+
if(coll)
{
- shprog = material->create_compatible_shader(*coll);
+ shprog = material->create_compatible_shader(*coll, extra_spec);
shprog.keep();
}
else
return (shprog && i!=textures.end() ? shprog->get_uniform_binding(i->tag) : -1);
}
+void RenderPass::set_receive_shadows(bool rs)
+{
+ receive_shadows = rs;
+}
+
void RenderPass::apply(Renderer &renderer) const
{
for(vector<TextureSlot>::const_iterator i=textures.begin(); i!=textures.end(); ++i)
add("material", &Loader::material);
add("material_slot", &RenderPass::material_slot);
add("back_faces",&RenderPass::back_faces);
+ add("receive_shadows", &RenderPass::receive_shadows);
add("texture", &Loader::texture);
add("uniforms", &Loader::uniforms);
add("uniform_slot", &Loader::uniform_slot);