Use a separate pass name for rendering shadow maps to allow for optimization
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();)
Bind _bind_fbo(fbo);
glViewport(0, 0, size, size);
glClear(GL_DEPTH_BUFFER_BIT);
- scene.render();
+ scene.render("shadow");
matrix_mode(PROJECTION);
pop_matrix();