]> git.tdb.fi Git - libs/gl.git/blobdiff - source/effects/shadowmap.h
Add tetrahedron shadow maps for point lights
[libs/gl.git] / source / effects / shadowmap.h
index cf2dec01bc69e90afda1255dd63918fd5b8d5ebc..0acb1b64657bc2cc0c5d0837717883fb0bd1b77f 100644 (file)
@@ -14,6 +14,7 @@ namespace GL {
 
 class DirectionalLight;
 class Light;
+class PointLight;
 
 /**
 Creates shadows on a renderable through a shadow map texture.  In the setup
@@ -27,7 +28,8 @@ private:
        enum ShadowType
        {
                NONE,
-               DIRECTIONAL
+               DIRECTIONAL,
+               TETRAHEDRON
        };
 
        struct ShadowedLight
@@ -45,6 +47,7 @@ private:
                unsigned light_index;
                unsigned face;
                Camera camera;
+               Matrix face_matrix;
        };
 
        unsigned width;
@@ -69,6 +72,7 @@ public:
        ShadowMap(unsigned, unsigned, Renderable &, const Lighting &);
 
        void add_light(const DirectionalLight &, unsigned, Renderable &);
+       void add_light(const PointLight &, unsigned, Renderable &);
 private:
        void add_light(const Light &, unsigned, ShadowType, Renderable &);