This time we don't need a new compositor. We are just going to modify the application a bit:
Ogre::CompositorManager::getSingleton().addCompositor(mCamera->getViewport(), "Compositor3"); Ogre::CompositorManager::getSingleton().setCompositorEnabled(mCamera->getViewport(), "Compositor3", true);
Ogre::CompositorManager::getSingleton().addCompositor(mCamera->getViewport(), "Compositor2"); Ogre::CompositorManager::getSingleton().setCompositorEnabled(mCamera->getViewport(), "Compositor2", true);
We combined two compositors using the addCompositor()
function. This function can take any number of compositors and chain them together; the output result of one will be the input of the other. If we want to add a compositor at a certain position, we can pass the position as the third parameter of the addCompositor()
function. With this function, we can combine all sorts of different compositors without the need to write a single line of script. It also enables us to reuse compositors in other chains because we don't have to hardcode chains in scripts.
18.217.214.141