Class which defines a scene render. More...
#include <MViewport2Renderer.h>
Public Member Functions | |
MSceneRender (const MString &name) | |
Constructor for a named scene render. More... | |
MSceneRender (const MString &name, const MString &fragmentName) | |
Constructor for a named scene render that uses a custom fragment to render with. More... | |
~MSceneRender () override | |
Default destructor for a scene render. | |
virtual void | preRender () |
Method to allow for the operation to update itself before being executed. More... | |
virtual void | postRender () |
Method to allow for the operation to clean up itself after being executed. More... | |
virtual void | preSceneRender (const MDrawContext &context) |
Method to allow for the operation to update itself before a scene rendering begins. More... | |
virtual void | postSceneRender (const MDrawContext &context) |
Method to allow for the operation to update itself after a scene rendering ends. More... | |
virtual MSceneFilterOption | renderFilterOverride () |
This method allows for the programmer to provide feedback on determining which elements of a scene render will be drawn based on semantic meaning. More... | |
virtual const MCameraOverride * | cameraOverride () |
Query for a camera override. More... | |
virtual const MSelectionList * | objectSetOverride () |
Query for override for the set of objects to view. More... | |
virtual const MShaderInstance * | shaderOverride () |
Query for a scene level shader override. More... | |
virtual MUint64 | getObjectTypeExclusions () |
Query for any object type exclusions. More... | |
virtual MDisplayMode | displayModeOverride () |
Query for any display mode override. More... | |
virtual MLightingMode | lightModeOverride () |
Query for any lighting mode override. More... | |
virtual const bool * | shadowEnableOverride () |
Query for shadow display override. More... | |
virtual MPostEffectsOverride | postEffectsOverride () |
Query for post effects override. More... | |
virtual MCullingOption | cullingOverride () |
Query for a face culling override. More... | |
virtual MClearOperation & | clearOperation () |
Get the scene clear operation. More... | |
virtual bool | hasUIDrawables () const |
If you've overridden addPreUIDrawables() or addPostUIDrawables() then you must override this method to return true in order for them to have any effect. More... | |
virtual void | addPreUIDrawables (MUIDrawManager &drawManager, const MFrameContext &frameContext) |
Provides access to the MUIDrawManager, which can be used to queue up operations to draw simple UI shapes like lines, circles, text, etc. More... | |
virtual void | addPostUIDrawables (MUIDrawManager &drawManager, const MFrameContext &frameContext) |
Provides access to the MUIDrawManager, which can be used to queue up operations to draw simple UI shapes like lines, circles, text, etc. More... | |
MRenderParameters * | getParameters () |
Get the block of input parameters used to control the renderer. More... | |
MString | fragmentName () |
Get the name of the fragment to use when rendering the scene. More... | |
virtual MObjectTypeExclusions | objectTypeExclusions () |
This method is obsolete. 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 | |
MClearOperation | mClearOperation |
Clear operation. | |
![]() | |
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... | |
Class which defines a scene render.
Object type exclusions This enumeration is marked to be deprecated.
Use the MFramentContext static member equivalents instead which is a superset of this enumeration.
enum MSceneFilterOption |
Render filter options.
Refer to the renderFilterOverride() method for details on usage.
enum MDisplayMode |
Display modes.
enum MLightingMode |
enum MPostEffectsOverride |
Post effect override.
enum MCullingOption |
MSceneRender | ( | const MString & | name | ) |
Constructor for a named scene render.
A default clear operation is created which will be used for scene rendering. This is a convenience such that separate clear operations do not need to be added before each scene render.
[in] | name | Name of scene render |
MSceneRender | ( | const MString & | name, |
const MString & | fragmentName | ||
) |
Constructor for a named scene render that uses a custom fragment to render with.
A default clear operation is created which will be used for scene rendering. This is a convenience such that separate clear operations do not need to be added before each scene render.
[in] | name | Name of scene render |
[in] | fragmentName | Name of fragment used to render with |
|
virtual |
Method to allow for the operation to update itself before being executed.
In general this would be used to update any operation parameters.
No context information is available at this point.
By default this method performs no action.
|
virtual |
Method to allow for the operation to clean up itself after being executed.
By default this method performs no action.
|
virtual |
Method to allow for the operation to update itself before a scene rendering begins.
This method will be called before computing shadow maps, and before a color pass.
[in] | context | Draw context before rendering begins |
By default this method performs no action.
|
virtual |
Method to allow for the operation to update itself after a scene rendering ends.
This method will be called after computing shadow maps, and after a color pass.
[in] | context | Draw context after rendering has completed |
By default this method performs no action.
|
virtual |
This method allows for the programmer to provide feedback on determining which elements of a scene render will be drawn based on semantic meaning.
For now the only meanings are:
Non-UI related elements currenty includes rendering surfaces which are shaded. Surfaces are defined as polygonal meshes, subdivision surfaces, and nurbs surfaces.
UI related elements includes drawing the wireframe and component "UI" for the above surface types as well as non-surface items.
A general way to think of the two options is that "non-UI" can be related to drawing a "beauty" pass, and "UI" are decorations on of the "beauty" pass.
We will call these semantic meanings "scene filters" which are enumerated by MSceneRender::MSceneFilterOption.
The default return value is kNoSceneFilterOverride. This indicates that the a scene render will render all scene elements.
|
virtual |
Query for a camera override.
The default implementation returns that there is no override.
|
virtual |
Query for override for the set of objects to view.
Visibility takes into account the current states of each object, any display filters, and camera frustum culling.
Note that the override only applies to rendering but not selection.
By default NULL is returned which indicates that no override is present.
|
virtual |
Query for a scene level shader override.
By default a NULL value is returned which indicates that there is no shader override.
|
virtual |
Query for any object type exclusions.
By default kExcludeNone is returned meaning to not exclude drawing of any types.
If there has already been an exclusion which is specified, for example via the viewport then those exclusions will still apply.
|
virtual |
Query for any display mode override.
By default kNoDisplayModeOverride is returned indicating that no override is specified.
|
virtual |
Query for any lighting mode override.
By default kNoLightingModeOverride is returned indicating that no override is specified.
|
virtual |
Query for shadow display override.
By default a NULL value is returned indicating that no override is specified. To force shadowing off or on, return a pointer to a false or true boolean (respectively).
|
virtual |
Query for post effects override.
By default MSceneRender::kPostEffectDisableNone is returned which indicates that there is no override.
|
virtual |
Query for a face culling override.
By default kNoCullingOverride is returned indicating that no override is specified.
|
virtual |
Get the scene clear operation.
|
virtual |
If you've overridden addPreUIDrawables() or addPostUIDrawables() then you must override this method to return true in order for them to have any effect.
You also need to have kRenderPreSceneUIItems or kRenderPostSceneUIItems set in the mask returned by renderFilterOverride().
|
virtual |
Provides access to the MUIDrawManager, which can be used to queue up operations to draw simple UI shapes like lines, circles, text, etc.
This method will only be called when hasUIDrawables() is overridden to return true and kRenderPreSceneUIItems is set in the MSceneFilterOption mask returned by renderFilterOverride().
UI drawables added in this method will be rendered before the scene render.
[in] | drawManager | The UI draw manager, it can be used to draw some simple geometry including text. |
[in] | frameContext | Frame level context information |
|
virtual |
Provides access to the MUIDrawManager, which can be used to queue up operations to draw simple UI shapes like lines, circles, text, etc.
This method will only be called when hasUIDrawables() is overridden to return true and kRenderPostSceneUIItems is set in the MSceneFilterOption mask returned by renderFilterOverride().
UI drawables added in this method will be rendered after the scene render.
[in] | drawManager | The UI draw manager, it can be used to draw some simple geometry including text. |
[in] | frameContext | Frame level context information |
MRenderParameters * getParameters | ( | ) |
Get the block of input parameters used to control the renderer.
Parameter input values can be acquired or set by name.
MString fragmentName | ( | ) |
Get the name of the fragment to use when rendering the scene.
Must be the name of a valid script fragment or fragment graph added through the FragmentManager.
|
virtual |
This method is obsolete.
Query for any object type exclusions.
[as of Maya 2019]
By default kExcludeNone is returned meaning to not exclude drawing of any types.
If there has already been an exclusion which is specified, for example via the viewport then those exclusions will still apply.