From: Mikko Rasa Date: Tue, 14 Jul 2009 13:53:12 +0000 (+0000) Subject: Reset viewport also after pass-specific effects X-Git-Tag: 1.1~4 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=83bf78244e92ca6731edd8075f158fcec6e53027;p=libs%2Fgl.git Reset viewport also after pass-specific effects Use a separate pass name for rendering shadow maps to allow for optimization --- diff --git a/source/pipeline.cpp b/source/pipeline.cpp index 6a9556a6..b0a38a2d 100644 --- a/source/pipeline.cpp +++ b/source/pipeline.cpp @@ -101,7 +101,10 @@ void Pipeline::render(const Tag &tag) const if(pass.lighting) pass.lighting->bind(); for(vector::const_iterator i=pass.effects.begin(); i!=pass.effects.end(); ++i) + { (*i)->prepare(); + glViewport(0, 0, width, height); + } for(vector::const_iterator i=renderables.begin(); i!=renderables.end(); ++i) (*i)->render(tag); for(vector::const_iterator i=pass.effects.end(); i--!=pass.effects.begin();) diff --git a/source/shadowmap.cpp b/source/shadowmap.cpp index 9b27ba08..9c8b57bf 100644 --- a/source/shadowmap.cpp +++ b/source/shadowmap.cpp @@ -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();