]> git.tdb.fi Git - libs/gl.git/blobdiff - source/bloom.cpp
Disable blend and depth test while rendering Bloom
[libs/gl.git] / source / bloom.cpp
index b9e626989e1e585def0f45395cf6e5ff7ac1f016..b74bde80f970dd16f597452963a3863b7e2e50d3 100644 (file)
@@ -7,8 +7,11 @@ Distributed under the LGPL
 
 #include <cmath>
 #include <msp/strings/formatter.h>
+#include "blend.h"
 #include "bloom.h"
 #include "meshbuilder.h"
+#include "misc.h"
+#include "tests.h"
 #include "texunit.h"
 
 using namespace std;
@@ -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