Time for action — complex compositor

We need a new compositor, material, and fragment shader:

  1. The compositor script itself is nothing special. We need one texture for the scene and then directly use this texture as input for the output, which uses one material:
    compositor Compositor7
    {
    technique
    {
    texture scene target_width target_height PF_R8G8B8
    target scene
    {
    input previous
    }
    target_output
    {
    input none
    pass render_quad
    {
    material Ogre3DBeginnersGuide/Comp5
    input 0 scene
    }
    }
    }
    }
    
  2. The material itself is also nothing new; just add a fragment shader like always:
    material Ogre3DBeginnersGuide/Comp5
    {
    technique
    {
    pass
    {
    fragment_program_ref MyFragmentShader8
    {
    }
    texture_unit
    {
    }
    }
    }
    }
    
  3. Don't forget to add the definition of the fragment shader before using ...

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.