X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Feffects%2Fshadowmap.h;h=611f56f51040a2204055e29f37d0e67a68d48b7c;hb=c8520aa336e92f2eaf9a38c3430c608520a90324;hp=c3c7bd55a7f53430937cce8faf6f6955b220f61d;hpb=a2b0d155023ca23afe7848ae5d17e0f7bc328525;p=libs%2Fgl.git diff --git a/source/effects/shadowmap.h b/source/effects/shadowmap.h index c3c7bd55..611f56f5 100644 --- a/source/effects/shadowmap.h +++ b/source/effects/shadowmap.h @@ -12,6 +12,7 @@ namespace Msp { namespace GL { +class DirectionalLight; class Light; /** @@ -40,19 +41,19 @@ private: Texture2D depth_buf; const Sampler &sampler; Vector3 target; - float radius; - float depth_bias; - float darkness; + float radius = 1.0f; + float depth_bias = 4.0f; + float darkness = 1.0f; ProgramData shdata; - bool rendered; + bool rendered = false; std::string debug_name; ShadowMap(unsigned, unsigned, Renderable &, const Lighting *, Renderable &); public: - ShadowMap(unsigned, Renderable &, const Light &, Renderable &); + ShadowMap(unsigned, Renderable &, const DirectionalLight &, Renderable &); ShadowMap(unsigned, unsigned, Renderable &, const Lighting &, Renderable &); - void add_light(const Light &, unsigned); + void add_light(const DirectionalLight &, unsigned); /** Sets the ShadowMap target point and radius. The transformation matrix is computed so that a sphere with the specified parameters will be completely