Rendering Overrides

This section describes the new rendering interface. It is intended to subsume the existing hardware “multi-pass” interface which is exposed in MPx3dModelView.

Main Features of the New Interface

Key Differences in the New Interface

Key Concepts and Constructs

Render Override

There is a formal notion of a rendering override. An override will override all rendering per refresh for interactive rendering or per frame output for batch rendering. An override is composed of a set of rendering operations. The key class for this is MRenderOverride.

Render Operation

An operation can be loosely thought of as being equivalent to a “pass” in the MPx3dModelView pass based system, except that they are explicitly defined. The key class for this is MRenderOperation. There can be predefined operations as well as custom user operations. The basic operation set includes:

Render Target Overrides

Render targets are now formalized. This is so that there is a managed and recognized set of resources that both the renderer and the plugin writer can use. Being formalized also means that the resource can be defined in a draw API agnostic way (e.g. for OpenGL and DirectX). The interface presented is a render target description, MRenderTargetDescription. The descriptions are used to describe desired render target inputs or outputs for rendering operations.

Shader Overrides

The MShaderManager interface allows access to some simple stock shaders as well as access to file based effects. These shaders can then be applied as overrides in one of two places:

State Overrides

State setting has been formalized and is managed by the renderer. State setting can be performed per render operation.

General Scene and User Operation Overrides

Basic overrides formally presented include:

Render Logic Building

The main steps for defining a render override are:

  1. Derive a custom render override.
  2. Register the override with the renderer. Any number of overrides can be registered.
  3. Set the active override for a viewport or for batch rendering.
  4. Set up a set of render operations and overrides as an ordered list. If the render logic is a graph, then this can be broken down into a series of render operations.
  5. Provide the list of operations when queried and update parameters per operation as required.
  6. Custom operations and custom overrides have the ability to intercept intermediate and final render targets and may do so to use the resources as required (e.g. to save to disk, or to route to custom rendering code).

Key Restrictions