By using the previous code we are going to reduce the texture count of our compositor.
We need a new compositor, this time with only one texture:
compositor Compositor5
{
technique
{
texture scene target_width target_height PF_R8G8B8
Then fill the texture with the rendered scene:
target scene
{
input previous
}
Use this texture as the input texture as well as the output texture:
target scene
{
pass render_quad
{
material Ogre3DBeginnersGuide/Comp2
input 0 scene
}
}
Again, use this texture as input for the final rendering:
target_output
{
input none
pass render_quad
{
material Ogre3DBeginnersGuide/Comp3
input 0 scene
}
}
Add the missing parenthesis:
}
}
Compile and run the application. The result will be the same, but this time we only use one texture.
What just happened?
We changed our compositor to only use one texture and discovered that we can use a texture more than once in a compositor. We also found out that we can use it as input and output texture at the same time.