- Bind bind_fbo(fbo, true);
- fbo.clear(DEPTH_BUFFER_BIT);
- renderable.render("shadow");
- }
+ Bind bind_fbo(fbo, true);
+ Bind bind_depth(DepthTest::lequal());
+ fbo.clear(DEPTH_BUFFER_BIT);
+ renderable.render("shadow");
+}
+
+void ShadowMap::finish_frame() const
+{
+ renderable.finish_frame();
+ rendered = false;
+}
+
+void ShadowMap::render(Renderer &renderer, const Tag &tag) const
+{
+ if(!enabled_passes.count(tag))
+ return renderer.render(renderable, tag);
+
+ const float *matrix = light_matrix.data();