X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Feffects%2Fambientocclusion.cpp;h=a519b80aaf7e67090908f159bd076b72cb624b8c;hb=ae423e6ef278388f92802fbae34b1c7ec339292f;hp=8149e408ee0a1dcc323e441c61c91d4f58842349;hpb=38712d8ecc57d043a2419ffbaeeb57f7a6586f14;p=libs%2Fgl.git diff --git a/source/effects/ambientocclusion.cpp b/source/effects/ambientocclusion.cpp index 8149e408..a519b80a 100644 --- a/source/effects/ambientocclusion.cpp +++ b/source/effects/ambientocclusion.cpp @@ -12,7 +12,7 @@ using namespace std; namespace Msp { namespace GL { -AmbientOcclusion::AmbientOcclusion(unsigned w, unsigned h, float): +AmbientOcclusion::AmbientOcclusion(unsigned w, unsigned h): rotate_lookup(get_or_create_rotate_lookup()), occlude_target(w, h, (COLOR_ATTACHMENT,R8)), occlude_shader(Resources::get_global().get("_ambientocclusion_occlude.glsl.shader")), @@ -32,7 +32,7 @@ const Texture2D &AmbientOcclusion::get_or_create_rotate_lookup() { Resources &resources = Resources::get_global(); - static const string name = "_ambientocclusion_rotate.tex2d"; + static const string name = "_ambientocclusion_rotate.tex"; Texture2D *rotate_lookup = resources.find(name); if(rotate_lookup) return *rotate_lookup; @@ -109,10 +109,14 @@ void AmbientOcclusion::render(Renderer &renderer, const Texture2D &color, const renderer.set_texture("rotate", &rotate_lookup, &nearest_sampler); renderer.set_shader_program(&occlude_shader, &shdata); + renderer.set_pipeline_key(this); renderer.set_framebuffer(&occlude_target.get_framebuffer()); + renderer.clear(0); quad.draw(renderer); + renderer.set_pipeline_key(this, 1); renderer.set_framebuffer(out_fbo); + renderer.clear(0); renderer.set_shader_program(&combine_shader); quad.draw(renderer); }