for(unsigned i=0; i<2; ++i)
{
blur_shdata[i].uniform(loc, 0);
- tex[i].storage(RGB16F, w, h, 0);
- tex[i].image(0, RGB, UNSIGNED_BYTE, 0);
tex[i].set_min_filter(NEAREST);
+ tex[i].storage(RGB16F, w, h);
}
combine_shdata.uniform(combine_shader.get_uniform_location("source"), 1);
combine_shdata.uniform(combine_shader.get_uniform_location("strength"), s);
}
-void Bloom::render(const Texture2D &src)
+void Bloom::render(const Texture2D &src, const Texture2D &)
{
const Framebuffer *dest = Framebuffer::current();
blur_shader.bind();
fbo.bind();
src.bind_to(0);
- disable(DEPTH_TEST);
- disable(BLEND);
+ Bind unbind_dtest(static_cast<DepthTest *>(0), true);
+ Bind unbind_blend(static_cast<Blend *>(0), true);
for(unsigned i=0; i<2; ++i)
{
fbo.attach(COLOR_ATTACHMENT0, tex[i], 0);
src.bind_to(1);
quad.draw();
Program::unbind();
- Texture::unbind();
- TexUnit::activate(0);
- Texture::unbind();
- // XXX Should check if the modes were enabled in the first place
- enable(DEPTH_TEST);
- enable(BLEND);
+ Texture::unbind_from(1);
+ Texture::unbind_from(0);
}
} // namespace GL