I was messing around a bit with that, since I wanted to have the ability in my application to have post-processing applied to only my 3D Scene, but also the ability to have post-processing applied to everything including the GUI.
What I ended up doing was creating 2 screen quads, each with it's own RTT, and each one using it's own shader, and my main loop contained something like this:
Code: Select all
mSceneMgr->getVideoDriver()->setRenderTarget(mSceneOnlyQuad->getMaterial(0).TextureLayer[0].Texture, true, true, color);
mSceneMgr->drawAll(); //Draw only the 3D Scene to mSceneOnlyQuad
mSceneMgr->getVideoDriver()->setRenderTarget(mEverythingQuad->getMaterial(0).TextureLayer[0].Texture, true, true, color);
mSceneOnlyQuad->render(); //Draw mSceneOnlyQuad to mEverythingQuad
mGUIMgr->drawAll(); //Draw the GUI to mEverythingQuad
mSceneMgr->getVideoDriver()->setRenderTarget(0, true, true, color);
mEverythingQuad->render(); //Draw mEverythingQuad to the frame buffer
I realize that in this situation, since I want some stuff shader'd, and some stuff not (or rather, some stuff in both shaders, and some stuff in only 1...) that it's not quite the same thing, but later on, I'd like to allow for, say, my mSceneOnlyQuad to have 2 or 3 different shaders applied to it- so would I have to do a similar thing to what I have now, basically creating a stack of screenQuads, or is there another means thru which I can achieve the multiple shader passes on 1 screenQuad?
On the subject of screen quads, is there a way via [Irrlicht] code to position the screen quad in front of the screen (ie where it should be)? Currently my code relies on the shader to do that for it, but as soon as I set the material type to something non-shader, obviously, the quad is no longer in front of the screen. I suppose I could come up with a "do nothing" shader that only positions the quad in front of the screen, but then anybody who's video cards don't support shaders can't use my application at all>< So I was hoping to be able to do the screen quad placement with code if possible...