]> 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 9b27ba08d5a5f9e7fff423a1544aaafe827c9018..3691773ad3f58d9ae41ffb1148291b10acd08d32 100644 (file)
@@ -95,15 +95,20 @@ 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();
+               scene.render("shadow");
 
                matrix_mode(PROJECTION);
                pop_matrix();
                matrix_mode(MODELVIEW);
                pop_matrix();
+               if(old_fbo)
+                       old_fbo->bind();
+               else
+                       Framebuffer::unbind();
        }
 
        depth_buf.bind_to(3);