5 #include "framebuffer.h"
6 #include "programdata.h"
17 Creates shadows on a Scene through a shadow map texture. In the preparation
18 phase, the scene is rendered to a depth texture from the point of view of the
19 lightsource. This texture is then used in the rendering phase together with
20 texture coordinate generation to determine whether each fragment is lit.
22 class ShadowMap: public Effect
27 mutable Framebuffer fbo;
35 ShadowMap(unsigned, const Renderable &, const Light &);
37 /** Sets the ShadowMap target point and radius. The transformation matrix is
38 computed so that a sphere with the specified parameters will be completely
39 covered by the ShadowMap. */
40 void set_target(const Vector3 &, float);
42 /** Sets the texture unit to bind the shadow map to during the rendering
43 phase. The default is texture unit 3. */
44 void set_texture_unit(unsigned);
46 virtual void render(Renderer &, const Tag &) const;