fbo.require_complete();
set_darkness(0.7);
+ shdata.uniform("shd_world_matrix", Matrix());
}
void ShadowMap::set_target(const Vector3 &t, float r)
shadow_matrix.translate(-0.5, -0.5, depth_bias/size-0.5);
shadow_matrix.invert();
+ shdata.uniform("shd_world_matrix", shadow_matrix);
+
BindRestore bind_fbo(fbo);
Bind bind_depth(DepthTest::lequal());
fbo.clear(DEPTH_BUFFER_BIT);
if(!enabled_passes.count(tag))
return renderer.render(renderable, tag);
- 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::Push _push_rend(renderer);
renderer.set_texture("shadow_map", &depth_buf, &sampler);