From 83bf78244e92ca6731edd8075f158fcec6e53027 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 14 Jul 2009 13:53:12 +0000 Subject: [PATCH] Reset viewport also after pass-specific effects Use a separate pass name for rendering shadow maps to allow for optimization --- source/pipeline.cpp | 3 +++ source/shadowmap.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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(); -- 2.45.2