#include <MViewport2Renderer.h>
Class which defines the operation of clearing render target channels.
Public Types | |
enum | ClearMask { kClearNone = 0, kClearColor = 1, kClearDepth = 1 << 1, kClearStencil = 1 << 2, kClearAll = ~0 } |
ClearMask describes the set of channels to clear If the mask value is set then that given channel will be cleared. More... | |
![]() | |
enum | MRenderOperationType { kClear, kSceneRender, kQuadRender, kUserDefined, kHUDRender, kPresentTarget } |
Supported render operation types. More... | |
Public Member Functions | |
MClearOperation (const MString &name) | |
Constructor for a named clear operation. More... | |
virtual | ~MClearOperation () |
Default destructor. | |
bool | overridesColors () const |
Query whether clear colors are set by the override or come from Maya's preferences. More... | |
unsigned int | mask () const |
Query the clear mask. More... | |
const float * | clearColor () const |
Query the first clear color value. More... | |
bool | clearGradient () const |
Query if the clear should clear with a gradient. More... | |
const float * | clearColor2 () const |
Query the second clear color value. More... | |
int | clearStencil () const |
Query the stencil clear value. More... | |
float | clearDepth () const |
Query the clear depth value. More... | |
void | setOverridesColors (bool override) |
Set the enabled state to control whether the clear operation overrides Maya's color preferences. More... | |
void | setMask (unsigned int mask) |
Set the clear mask to define which channels to clear. More... | |
void | setClearColor (float value[4]) |
Set the clear color value. More... | |
void | setClearGradient (bool value) |
Set whether to clear with a vertical color gradient. More... | |
void | setClearColor2 (float value[4]) |
Set the clear second color value. More... | |
void | setClearStencil (int value) |
Set the clear stencil value. More... | |
void | setClearDepth (float value) |
Set the clear depth value. More... | |
![]() | |
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 Attributes | |
unsigned int | mClearMask |
Clear mask. | |
float | mClearColor [4] |
Clear color value. | |
float | mClearColor2 [4] |
Secondary clear color value. More... | |
bool | mClearGradient |
Flag to indicate whether to clear the gradient. | |
int | mClearStencil |
Clear stencil value. | |
float | mClearDepth |
Clear depth value. | |
![]() | |
MRenderOperationType | mOperationType |
Operation type. | |
MString | mName |
Identifier for a sub render. | |
Additional Inherited Members | |
![]() | |
MRenderOperation (const MString &name) | |
Protected constructor. More... | |
MRenderTarget * | getInputTarget (const MString &name) |
Gets the target associated with this input. More... | |
enum ClearMask |
MClearOperation | ( | const MString & | name | ) |
Constructor for a named clear operation.
The default is clear operation sets color, depth and stencil to all be cleared. The default clear colors are opaque black, the default stencil value is 0 and the default depth value is 1.0;
By default a color gradient is not used.
[in] | name | The name that will be given to the operation. |
bool overridesColors | ( | ) | const |
Query whether clear colors are set by the override or come from Maya's preferences.
unsigned int mask | ( | ) | const |
Query the clear mask.
Bit flags can be tested with the MClearOperation::ClearMask enumeration.
const float * clearColor | ( | ) | const |
Query the first clear color value.
bool clearGradient | ( | ) | const |
Query if the clear should clear with a gradient.
const float * clearColor2 | ( | ) | const |
Query the second clear color value.
int clearStencil | ( | ) | const |
Query the stencil clear value.
float clearDepth | ( | ) | const |
Query the clear depth value.
void setOverridesColors | ( | bool | val | ) |
Set the enabled state to control whether the clear operation overrides Maya's color preferences.
[in] | val | enable or disable color overrides. |
void setMask | ( | unsigned int | mask | ) |
Set the clear mask to define which channels to clear.
[in] | mask | Clear mask to set. |
void setClearColor | ( | float | value[4] | ) |
Set the clear color value.
This will be the color used at the top of the gradient if a color gradient is specified.
[in] | value | Color value to set |
void setClearGradient | ( | bool | value | ) |
Set whether to clear with a vertical color gradient.
If a gradient is used then mClearColor is the color at the top of gradient, and mClearColor2 is the color at the bottom of the gradient.
[in] | value | Whether to use a gradient |
void setClearColor2 | ( | float | value[4] | ) |
Set the clear second color value.
Only used when a color gradient is to be used.
[in] | value | Color value to set |
void setClearStencil | ( | int | value | ) |
Set the clear stencil value.
[in] | value | Stencil value |
void setClearDepth | ( | float | value | ) |
Set the clear depth value.
[in] | value | Depth value |
|
protected |
Secondary clear color value.
Used when gradient background drawing enabled