I use FBO to render multi pass blur shader in my LevelScreen render method. What I want to achieve is to make a MenuScreen that render the LevelScreen on background applying another blur effect on top of it.
here is the pseudo code
protected void render(float delta) {
// render the scene to the FBO
fbo.begin();
levelScreen.render(delta);
fbo.end();
// retrieve texture and flip Y
Sprite background = new Sprite(fbo.getColorBufferTexture());
background.flip(false, true);
// apply the blurX shader and
// render the sprite
batch.setShader(blurH);
batch.begin();
background.draw(batch);
batch.end();
}
The problem is that the levelScreen.render()
function already contains a fbo.begin()
fbo.end()
and the scene is directly rendered on the screen.
Is there a way to handle properly nested fbo?