Multipass Rendering


For an overview about Renderers, see General Information. For a list of all Renderer functions and related topics, see Rendering.

Multipass rendering enables the renderer to perform operations, such as multipass transparency (see transparency method), that require the output commands defining a single scene to be processed more than once. Specify the pipeline state and the renderer attributes to indicate the operations performed during multipass rendering to achieve the effects desired.

A multipass session is initiated by the PEXInitMultipass function. The renderer must already be in the PEXRendering state. All output commands subsequently passed to the renderer are considered part of a pass, many of which may be required to produce the requested effects. The first pass consists of the output commands sent to the renderer between the PEXInitMultipass function invocation and an invocation of the PEXNextPass function or PEXNextPassWithoutReply function. These latter two functions demarcate the end of the current pass and the beginning of the next. The implementation expects the same output commands to be sent in each pass.

One pass after another is performed until no more are needed. The number of passes required depends on the implementation and the types of operations you are performing. To determine the number of required passes, check the return value when you invoke the PEXNextPass function. This function returns a value indicating the number of additional passes needed, if the implementation can determine that, or simply that more passes are needed or that no more are needed.

A client performing simple multipass rendering begins a scene by invoking the PEXInitMultipass function. It then continually sends passes, demarcated by PEXNextPass function invocations, until the PEXNextPass function returns zero for the number of additional passes required. Options are defined for aborting a multipass session and for informing the implementation to produce the best image it can with only one more pass.

Whether an implementation is capable of multipass rendering is determined by corresponding support for capabilities that require multipass rendering. The only defined capabilities in PEX 5.2 that require multipass rendering are transparency methods TransparencyTwoPass and TransparencyMultipass.