Class which defines a rendering operation. More...
#include <MViewport2Renderer.h>
Public Types | |
enum | MRenderOperationType { kClear, kSceneRender, kQuadRender, kUserDefined, kHUDRender, kPresentTarget } |
Supported render operation types. More... | |
Public Member Functions | |
virtual bool | enableSRGBWrite () |
Return whether to enable GPU based gamma correction during pixel writes. More... | |
virtual const MFloatPoint * | viewportRectangleOverride () |
Query for a viewport rectangle override. More... | |
virtual const MString & | name () const |
Query the name of a render operator. More... | |
virtual bool | getInputTargetDescription (const MString &name, MRenderTargetDescription &description) |
Return the description to use when creating the target for the named input. More... | |
virtual int | writableTargets (unsigned int &count) |
Return the index of the first writable target in the inputTargets list. More... | |
virtual MRenderTarget *const * | targetOverrideList (unsigned int &listSize) |
Return a list of pointers to render target which will be used as the target overrides for the operation. More... | |
const MStringArray & | inputTargets () |
An array of input target names that semantically declares the type of targets the operation requires as input. More... | |
const MStringArray & | outputTargets () |
An array of output target names that semantically declares the type of targets the operation can produce. More... | |
void | renameOutputTarget (const MString &name, const MString &newName) |
Renames an output target of an operation. More... | |
MRenderOperationType | operationType () const |
Query the type (MRenderOperationType) of a render operator. More... | |
Protected Member Functions | |
MRenderOperation (const MString &name) | |
Protected constructor. More... | |
MRenderTarget * | getInputTarget (const MString &name) |
Gets the target associated with this input. More... | |
Protected Attributes | |
MRenderOperationType | mOperationType |
Operation type. | |
MString | mName |
Identifier for a sub render. | |
Class which defines a rendering operation.
enum MRenderOperationType |
|
protected |
Protected constructor.
Only to be called from derived classes.
By default kColorTargetName and kDepthTargetName are set in both the input target name array (mInputTargetNames) and the output target name array (mOutputTargetNames). These inputs and outputs are all that are required for operations that simply write to an existing target. If an operation requires additional targets or different targets it should clear these lists after calling the base class constructor.
[in] | name | The name of the operation. |
|
virtual |
Return whether to enable GPU based gamma correction during pixel writes.
Hardware support assumes a gamma value of 2.2 which is equivalent to converting to sRGB space. This method thus indicates whether to enable the ability of a render target to perform an "sRGB write".
All render targets returned from the MRenderOperation::targetOverrideList() method which support this capability will have the appropriate gamma correction performed.
Gamma correction is never performed for the MPresentTarget render operation.
The method MRenderTargetManager::formatSupportsSRGBWrite() can be used to query whether a a given format for a render target can support this capability.
The default implementation of this method will return false.
Reimplemented in MPresentTarget.
|
virtual |
Query for a viewport rectangle override.
An override is specified using 4 float values. All values are are represented as relative percentages of the output target dimensions.
Examples :
|
virtual |
|
virtual |
Return the description to use when creating the target for the named input.
Most standard operations do not care about the format of the target they use and expect the target to be passed in. Supply a custom description in cases where the operation expects a new target to be created.
[in] | name | The name of the input to get the description for. |
[out] | description | The target description to use when creating a target for this input. |
|
virtual |
Return the index of the first writable target in the inputTargets list.
[out] | count | The number of writable targets returned. By default a value of 2 is returned for the standard color and depth targets. |
|
virtual |
Return a list of pointers to render target which will be used as the target overrides for the operation.
[out] | listSize | Number of targets returned. By default the writableTargets method is used to get the target count. |
const MStringArray & inputTargets | ( | ) |
An array of input target names that semantically declares the type of targets the operation requires as input.
This may include the standard color and depth targets and/or any other custom GBuffers, scene passes, etc used as input.
const MStringArray & outputTargets | ( | ) |
An array of output target names that semantically declares the type of targets the operation can produce.
This may include the standard color and depth targets and/or any other custom GBuffers, scene passes, etc produced by the operation.
Renames an output target of an operation.
Renaming an output allows you to connect the produced output of this operation to a custom named input on another MRenderOperation. Similarly named inputs and outputs will share render targets.
[in] | name | The name of the input to rename. |
[in] | newName | The new name to assign to the output. |
MRenderOperation::MRenderOperationType operationType | ( | ) | const |
Query the type (MRenderOperationType) of a render operator.
|
protected |
Gets the target associated with this input.
The target returned has either been set through and output by the caller who is indicating the target to draw to, or it is internally generated using the target descriptor provided for this input.
[in] | name | The name of the input to get the target for. |