]> git.tdb.fi Git - libs/gl.git/blobdiff - source/shadowmap.h
Add Vector3 and Vector4 classes
[libs/gl.git] / source / shadowmap.h
diff --git a/source/shadowmap.h b/source/shadowmap.h
new file mode 100644 (file)
index 0000000..17e17ca
--- /dev/null
@@ -0,0 +1,45 @@
+/* $Id$
+
+This file is part of libmspgl
+Copyright © 2009  Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
+#ifndef SHADOWMAP_H_
+#define SHADOWMAP_H_
+
+#include "effect.h"
+#include "framebuffer.h"
+#include "texture2d.h"
+#include "vector.h"
+
+namespace Msp {
+namespace GL {
+
+class Light;
+class Scene;
+
+class ShadowMap: public Effect
+{
+private:
+       unsigned size;
+       const Scene &scene;
+       const Light &light;
+       Framebuffer fbo;
+public:
+       Texture2D depth_buf;
+private:
+       Vector3 target;
+       float radius;
+
+public:
+       ShadowMap(unsigned, const Scene &, const Light &);
+       void set_target(const Vector3 &, float);
+       virtual void prepare();
+       virtual void cleanup();
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif