- Texture::unbind_from(unit);
- TexGen::unbind_from(SCOORD);
- TexGen::unbind_from(TCOORD);
- TexGen::unbind_from(RCOORD);
- TexUnit::activate(0);
+ unsigned unit = renderer.allocate_effect_texunit();
+ int iunit = unit;
+ shdata.uniform("shadow", iunit);
+
+ Bind _bind_depth(depth_buf, unit);
+
+ if(const Camera *camera = renderer.get_camera())
+ /* Multiply by camera's object matrix to form a matrix that transforms
+ from eye space to shadow space. */
+ shdata.uniform("shd_eye_matrix", shadow_matrix*camera->get_object_matrix());
+ else
+ shdata.uniform("shd_eye_matrix", shadow_matrix);
+
+ renderer.add_shader_data(shdata);
+ renderer.render(renderable, tag);