[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.2.3 Compositor Passes

A pass is a single rendering action to be performed in a target pass.

Format: ’pass’ (render_quad | clear | stencil | render_scene | render_custom) [custom name] { }

There are four types of pass:


This kind of pass sets the contents of one or more buffers in the target to a fixed value. So this could clear the colour buffer to a fixed colour, set the depth buffer to a certain set of contents, fill the stencil buffer with a value, or any combination of the above.


This kind of pass configures stencil operations for the subsequent passes. It can set the stencil compare function, operations and reference values for you to perform your own stencil effects.


This kind of pass performs a regular rendering of the scene. It will use the visibility_mask, lod_bias, and material_scheme from the parent target pass.


This kind of pass renders a quad over the entire render target, using a given material. You will undoubtedly want to pull in the results of other target passes into this operation to perform fullscreen effects.


This kind of pass is just a callback to user code for the composition pass specified in the custom name (and registered via CompositorManager::registerCustomCompositionPass) and allows the user to create custom render operations for more advanced effects. This is the only pass type that requires the custom name parameter.

Here are the attributes you can use in a ’pass’ section of a .compositor script:

Available Pass Attributes


For passes of type ’render_quad’, sets the material used to render the quad. You will want to use shaders in this material to perform fullscreen effects, and use the input attribute to map other texture targets into the texture bindings needed by this material.

Format: material <Name>


For passes of type ’render_quad’, this is how you map one or more local render textures (See compositor_texture) into the material you’re using to render the fullscreen quad. To bind more than one texture, repeat this attribute with different sampler indexes.

Format: input <sampler> <Name> [<MRTIndex>]


The texture sampler to set, must be a number in the range [0, OGRE_MAX_TEXTURE_LAYERS-1].


The name of the local render texture to bind, as declared in compositor_texture and rendered to in one or more target pass.


If the local texture that you’re referencing is a Multiple Render Target (MRT), this identifies the surface from the MRT that you wish to reference (0 is the first surface, 1 the second etc).

Example: input 0 rt0


Associates a numeric identifier with the pass. This is useful for registering a listener with the compositor (CompositorInstance::addListener), and being able to identify which pass it is that’s being processed when you get events regarding it. Numbers between 0 and 2^32 are allowed.

Format: identifier <number>

Example: identifier 99945

Default: identifier 0


For passes of type ’render_scene’, this sets the first render queue id that is included in the render. Defaults to the value of RENDER_QUEUE_SKIES_EARLY.

Format: first_render_queue <id>

Default: first_render_queue 0


For passes of type ’render_scene’, this sets the last render queue id that is included in the render. Defaults to the value of RENDER_QUEUE_SKIES_LATE.

Format: last_render_queue <id>

Default: last_render_queue 95


If set, indicates the material scheme to use for this pass only. Useful for performing special-case rendering effects.

This will overwrite the scheme if set at the target scope as well.

Format: material_scheme <scheme name>

Default: None

Clear Section

For passes of type ’clear’, this section defines the buffer clearing parameters.

Format: clear { }

Here are the attributes you can use in a ’clear’ section of a .compositor script:

Stencil Section

For passes of type ’stencil’, this section defines the stencil operation parameters.

Format: stencil { }

Here are the attributes you can use in a ’stencil’ section of a .compositor script:

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on August 20, 2012 using texi2html 5.0.