X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Feffects%2Fshadowmap.cpp;h=f688a6e3a7d4e858c23cf5126908475545bbe712;hb=91d87a3ecae2b21a87829442d82e65f071009e92;hp=35e851cd784ddae6a623f760e753979d106016a1;hpb=ce3658993ce2f6b7527a04a36a5e1af349c6f2e9;p=libs%2Fgl.git diff --git a/source/effects/shadowmap.cpp b/source/effects/shadowmap.cpp index 35e851cd..f688a6e3 100644 --- a/source/effects/shadowmap.cpp +++ b/source/effects/shadowmap.cpp @@ -14,30 +14,16 @@ namespace GL { ShadowMap::ShadowMap(unsigned s, Renderable &r, const Light &l, Renderable &c): Effect(r), + size(s), light(l), shadow_caster(c), - sampler(Resources::get_global().get("_linear_clamp_shadow.samp")) + sampler(Resources::get_global().get("_linear_clamp_shadow.samp")), + radius(1), + depth_bias(4), + rendered(false) { - init(s); -} - -ShadowMap::ShadowMap(unsigned s, Renderable &r, const Light &l): - Effect(r), - light(l), - shadow_caster(r), - sampler(Resources::get_global().get("_linear_clamp_shadow.samp")) -{ - init(s); -} - -void ShadowMap::init(unsigned s) -{ - size = s; - radius = 1; - depth_bias = 4; - rendered = false; - depth_buf.storage(DEPTH_COMPONENT32F, size, size, 1); + fbo.set_format((DEPTH_ATTACHMENT,DEPTH_COMPONENT32F)); fbo.attach(DEPTH_ATTACHMENT, depth_buf, 0); depth_test.enabled = true;