To combine two compositors, we need to create a new one:
To create a new compositor, we need two textures one for storing the scene and one for storing some temporary results:
compositor Compositor4 { technique { texture scene target_width target_height PF_R8G8B8 texture temp target_width target_height PF_R8G8B8
Fill the scene texture, as done previously, and then fill the temp texture using the scene texture and our black and white material:
target scene { input previous } target temp { pass render_quad { material Ogre3DBeginnersGuide/Comp2 input 0 scene } }
Then use the temporary material and our invert material to create the output texture:
target_output { input none pass render_quad { material Ogre3DBeginnersGuide/Comp3 input 0 temp } } } }
Compile and run the application; you should see a scene that first got converted to black and white and was then inverted.