]> git.tdb.fi Git - libs/gl.git/blobdiff - source/effects/shadowmap.h
Support effects and subordinate sequences inside sequence templates
[libs/gl.git] / source / effects / shadowmap.h
index 0acb1b64657bc2cc0c5d0837717883fb0bd1b77f..502480122fc68354e45c85adec5b8a3d22c328de 100644 (file)
@@ -24,6 +24,54 @@ texture coordinate generation to determine whether each fragment is lit.
 */
 class ShadowMap: public Effect
 {
+public:
+       struct Template: Effect::Template
+       {
+               class Loader: public DataFile::DerivedObjectLoader<Template, Effect::Template::Loader>
+               {
+               private:
+                       static ActionMap shared_actions;
+
+               public:
+                       Loader(Template &, Collection &);
+               private:
+                       virtual void init_actions();
+
+                       void light(const std::string &);
+                       void size_square(unsigned);
+                       void target(float, float, float);
+               };
+
+               struct ShadowedLight
+               {
+                       class Loader: public DataFile::ObjectLoader<ShadowedLight>
+                       {
+                       private:
+                               static ActionMap shared_actions;
+
+                       public:
+                               Loader(ShadowedLight &);
+                       private:
+                               virtual void init_actions();
+                       };
+
+                       const Light *light = 0;
+                       unsigned size;
+                       std::string shadow_caster_name;
+               };
+
+               unsigned width = 2048;
+               unsigned height = 2048;
+               const Lighting *lighting = 0;
+               std::vector<ShadowedLight> lights;
+               Vector3 target;
+               float radius = 1.0f;
+               float depth_bias = 4.0f;
+               float darkness = 1.0f;
+
+               virtual ShadowMap *create(const std::map<std::string, Renderable *> &) const;
+       };
+
 private:
        enum ShadowType
        {