How to update RTT only occasionaly?
Posted: Sat Mar 10, 2018 12:28 pm
In our application we have (aside from the main scene) a RTT that should only be updated once in a while, and it has its own SceneManager, with objects different from the main scene, and a compositor chain with some specialized post effects.
In Ogre 1.x we created a manual texture of type TU_RENDERTARGET, added a viewport to it, set setAutoUpdated(false), and called clear() and update() whenever we wanted to update it. During the application's "Edit Mode" this could happen every frame, but in "Normal Mode" this should typically only happen once by a change in setup/initialization.
How do we do this the best way in Ogre 2.1?
I am right now about to create a workspace for the TU_RENDERTARGET manual texture (which I still create using TextureManager::createManual), with a compositor node chain, and camera from the dedicated SceneManager. Are those steps ok?
But then I'm a bit stuck on how to update it on request, and not have it auto updated? Should I just invoke workspace->setEnabled(true) temporarily for one frame and then disable it? If so, is there are any performance cost of then afterwards having the idle disabled workspace?
(The texture is afterwards used as input to a compositor node post effect on the main scene for a "warping and blending" effect)
In Ogre 1.x we created a manual texture of type TU_RENDERTARGET, added a viewport to it, set setAutoUpdated(false), and called clear() and update() whenever we wanted to update it. During the application's "Edit Mode" this could happen every frame, but in "Normal Mode" this should typically only happen once by a change in setup/initialization.
How do we do this the best way in Ogre 2.1?
I am right now about to create a workspace for the TU_RENDERTARGET manual texture (which I still create using TextureManager::createManual), with a compositor node chain, and camera from the dedicated SceneManager. Are those steps ok?
But then I'm a bit stuck on how to update it on request, and not have it auto updated? Should I just invoke workspace->setEnabled(true) temporarily for one frame and then disable it? If so, is there are any performance cost of then afterwards having the idle disabled workspace?
(The texture is afterwards used as input to a compositor node post effect on the main scene for a "warping and blending" effect)