Time for action — combing two compositors in code

This time we don't need a new compositor. We are just going to modify the application a bit:

  1. First add and enable the invert compositor:
    Ogre::CompositorManager::getSingleton().addCompositor(mCamera->getViewport(), "Compositor3");
    Ogre::CompositorManager::getSingleton().setCompositorEnabled(mCamera->getViewport(), "Compositor3", true);
    
  2. Then add the black and white compositor:
    Ogre::CompositorManager::getSingleton().addCompositor(mCamera->getViewport(), "Compositor2");
    Ogre::CompositorManager::getSingleton().setCompositorEnabled(mCamera->getViewport(), "Compositor2", true);
    
  3. Again compile and run the application. The result should be the same, only this time we combined the compositor in our application ...

Get Ogre 3D 1.7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.