Time for action — decreasing the texture count

By using the previous code we are going to reduce the texture count of our compositor.

  1. We need a new compositor, this time with only one texture:
    compositor Compositor5
    {
    technique
    {
    texture scene target_width target_height PF_R8G8B8
    
  2. Then fill the texture with the rendered scene:
    target scene
    {
    input previous
    }
    
  3. Use this texture as the input texture as well as the output texture:
    target scene
    {
    pass render_quad
    {
    material Ogre3DBeginnersGuide/Comp2
    input 0 scene
    }
    }
    
  4. Again, use this texture as input for the final rendering:
    target_output
    {
    input none
    pass render_quad
    {
    material Ogre3DBeginnersGuide/Comp3
    input 0 scene
    }
    }
    
  5. Add the missing parenthesis:
    }
    }
    
  6. Compile and run the application. The result will be ...

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.