Restore original FBO after rendering ShadowMap
#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;
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);
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
push_matrix();
load_matrix(matrix);
- Bind _bind_fbo(fbo);
+ const Framebuffer *old_fbo=Framebuffer::current();
+ fbo.bind();
glViewport(0, 0, size, size);
glClear(GL_DEPTH_BUFFER_BIT);
scene.render("shadow");
pop_matrix();
matrix_mode(MODELVIEW);
pop_matrix();
+ if(old_fbo)
+ old_fbo->bind();
+ else
+ Framebuffer::unbind();
}
depth_buf.bind_to(3);