]> git.tdb.fi Git - libs/gl.git/blobdiff - source/shadowmap.cpp
Disable blend and depth test while rendering Bloom
[libs/gl.git] / source / shadowmap.cpp
index 9c8b57bf938ebfc6c87a37a138bc35b72b7a858a..3691773ad3f58d9ae41ffb1148291b10acd08d32 100644 (file)
@@ -95,7 +95,8 @@ void ShadowMap::prepare()
                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");
@@ -104,6 +105,10 @@ void ShadowMap::prepare()
                pop_matrix();
                matrix_mode(MODELVIEW);
                pop_matrix();
+               if(old_fbo)
+                       old_fbo->bind();
+               else
+                       Framebuffer::unbind();
        }
 
        depth_buf.bind_to(3);