X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbloom.cpp;h=b74bde80f970dd16f597452963a3863b7e2e50d3;hb=ac7c744dfb6e87481eea7081b84c5ae2f585ee7b;hp=8a3bf3b295923f425c2d0fec68d5ffad90a55e15;hpb=119d9819ac9e9a8d274d2410beffe54e470485a3;p=libs%2Fgl.git diff --git a/source/bloom.cpp b/source/bloom.cpp index 8a3bf3b2..b74bde80 100644 --- a/source/bloom.cpp +++ b/source/bloom.cpp @@ -7,8 +7,11 @@ Distributed under the LGPL #include #include +#include "blend.h" #include "bloom.h" #include "meshbuilder.h" +#include "misc.h" +#include "tests.h" #include "texunit.h" using namespace std; @@ -51,7 +54,7 @@ static const char combine_fs[]= "varying vec2 texcoord;\n" "void main()\n" "{\n" - " gl_FragColor=mix(texture2D(source, texcoord), texture2D(blurred, texcoord), strength);" + " gl_FragColor=mix(texture2D(source, texcoord), texture2D(blurred, texcoord), strength);\n" "}"; } @@ -130,6 +133,8 @@ void Bloom::render(const Texture2D &src) blur_shader.bind(); fbo.bind(); src.bind_to(0); + disable(DEPTH_TEST); + disable(BLEND); for(unsigned i=0; i<2; ++i) { fbo.attach(COLOR_ATTACHMENT0, tex[i], 0); @@ -151,6 +156,9 @@ void Bloom::render(const Texture2D &src) Texture::unbind(); TexUnit::activate(0); Texture::unbind(); + // XXX Should check if the modes were enabled in the first place + enable(DEPTH_TEST); + enable(BLEND); } } // namespace GL