]> git.tdb.fi Git - libs/gl.git/commitdiff
Reset viewport also after pass-specific effects
authorMikko Rasa <tdb@tdb.fi>
Tue, 14 Jul 2009 13:53:12 +0000 (13:53 +0000)
committerMikko Rasa <tdb@tdb.fi>
Tue, 14 Jul 2009 13:53:12 +0000 (13:53 +0000)
Use a separate pass name for rendering shadow maps to allow for optimization

source/pipeline.cpp
source/shadowmap.cpp

index 6a9556a61c5b3fd308cd0e8c0134e30ecec8f78e..b0a38a2d3240a11cc63dd8ee9c801e22a534514e 100644 (file)
@@ -101,7 +101,10 @@ void Pipeline::render(const Tag &tag) const
        if(pass.lighting)
                pass.lighting->bind();
        for(vector<Effect *>::const_iterator i=pass.effects.begin(); i!=pass.effects.end(); ++i)
+       {
                (*i)->prepare();
+               glViewport(0, 0, width, height);
+       }
        for(vector<const Renderable *>::const_iterator i=renderables.begin(); i!=renderables.end(); ++i)
                (*i)->render(tag);
        for(vector<Effect *>::const_iterator i=pass.effects.end(); i--!=pass.effects.begin();)
index 9b27ba08d5a5f9e7fff423a1544aaafe827c9018..9c8b57bf938ebfc6c87a37a138bc35b72b7a858a 100644 (file)
@@ -98,7 +98,7 @@ void ShadowMap::prepare()
                Bind _bind_fbo(fbo);
                glViewport(0, 0, size, size);
                glClear(GL_DEPTH_BUFFER_BIT);
-               scene.render();
+               scene.render("shadow");
 
                matrix_mode(PROJECTION);
                pop_matrix();