X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Feffects%2Fbloom.cpp;h=98afedfc17c924e1e1b1048488dd0e72497ce4dc;hb=6f39983060a27634c012f66c82fea0d09fea9774;hp=1204c81a9eadcb8b452d75af19e206a935f41738;hpb=9a63244c1342337915c4610401a24c09fa72cc3d;p=libs%2Fgl.git diff --git a/source/effects/bloom.cpp b/source/effects/bloom.cpp index 1204c81a..98afedfc 100644 --- a/source/effects/bloom.cpp +++ b/source/effects/bloom.cpp @@ -15,8 +15,8 @@ namespace Msp { namespace GL { Bloom::Bloom(Resources &resources, unsigned w, unsigned h): - blur_shader(resources.get("_bloom_blur.glsl")), - combine_shader(resources.get("_bloom_combine.glsl")), + blur_shader(resources.get("_bloom_blur.glsl.shader")), + combine_shader(resources.get("_bloom_combine.glsl.shader")), quad(resources.get("_fullscreen_quad.mesh")), nearest_sampler(resources.get("_nearest_clamp.samp")), linear_sampler(resources.get("_linear_clamp.samp")) @@ -27,11 +27,6 @@ Bloom::Bloom(Resources &resources, unsigned w, unsigned h): for(unsigned i=0; i<2; ++i) target[i] = new RenderTarget(w, h, (RENDER_COLOR,RGB16F)); - common_shdata.uniform("source", 0); - common_shdata.uniform("blurred", 1); - - combine_texturing.attach(1, target[1]->get_target_texture(RENDER_COLOR), &linear_sampler); - set_radius(2.0f); set_strength(0.2f); } @@ -76,13 +71,13 @@ void Bloom::render(Renderer &renderer, const Texture2D &src, const Texture2D &) { BindRestore bind_fbo(target[i]->get_framebuffer()); Renderer::Push push2(renderer); - renderer.set_texture(i ? &target[0]->get_target_texture(RENDER_COLOR) : &src, &nearest_sampler); + renderer.set_texture("source", (i ? &target[0]->get_target_texture(RENDER_COLOR) : &src), &nearest_sampler); renderer.add_shader_data(blur_shdata[i]); quad.draw(renderer); } - combine_texturing.attach(0, src, &nearest_sampler); - renderer.set_texturing(&combine_texturing); + renderer.set_texture("source", &src, &nearest_sampler); + renderer.set_texture("blurred", &target[1]->get_target_texture(RENDER_COLOR), &linear_sampler); renderer.set_shader_program(&combine_shader); quad.draw(renderer); }