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 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.83.28