MShaderInstance Class Reference

MShaderInstance Class Reference
+ Related help topics:

#include <MShaderManager.h>

Class Description

An instance of a shader that may be used with Viewport 2.0.

This class represents a shader that may be used with the MRenderItem class for rendering in Viewport 2.0.

+ Examples:

Public Types

enum  ParameterType {
  kInvalid, kBoolean, kInteger, kFloat,
  kFloat2, kFloat3, kFloat4, kFloat4x4Row,
  kFloat4x4Col, kTexture1, kTexture2, kTexture3,
  kTextureCube, kSampler
}
 Specifies parameter types. More...
 
typedef void(* DrawCallback) (MDrawContext &context, const MRenderItemList &renderItemList, MShaderInstance *shaderInstance)
 Definition for pre/post draw callback functions.
 

Public Member Functions

DrawCallback preDrawCallback () const
 Access the pre-draw callback function pointer set for the this shader instance. More...
 
DrawCallback postDrawCallback () const
 Access the post-draw callback function pointer set for the this shader instance. More...
 
void parameterList (MStringArray &list) const
 Get the names of all parameters that are settable on this shader instance. More...
 
ParameterType parameterType (const MString &parameterName) const
 Get the type of the named parameter, returns kInvalid if parameter is not found. More...
 
bool isArrayParameter (const MString &parameterName) const
 Determine whether the named parameter is an array. More...
 
MString semantic (const MString &parameterName) const
 Return the semantic for a named parameter. More...
 
MStatus setParameter (const MString &parameterName, bool value)
 Set a named, boolean parameter on the shader instance. More...
 
MStatus setParameter (const MString &parameterName, int value)
 Set a named, integer parameter on the shader instance. More...
 
MStatus setParameter (const MString &parameterName, float value)
 Set a named, float parameter on the shader instance. More...
 
MStatus setParameter (const MString &parameterName, const float *value)
 Set a named, float, float2, float3 or float4 parameter on the shader instance. More...
 
MStatus setParameter (const MString &parameterName, const MFloatVector &value)
 Set a named, float, float2, float3 parameter on the shader instance. More...
 
MStatus setParameter (const MString &parameterName, const MMatrix &value)
 Set a named, matrix parameter on the shader instance. More...
 
MStatus setParameter (const MString &parameterName, const MFloatMatrix &value)
 Set a named, matrix parameter on the shader instance. More...
 
MStatus setParameter (const MString &parameterName, MTextureAssignment &textureAssignment)
 Set a texture parameter on the shader instance. More...
 
MStatus setParameter (const MString &parameterName, MRenderTargetAssignment &targetAssignment)
 Set a named, texture parameter on the shader instance to a render target. More...
 
MStatus setParameter (const MString &parameterName, const MSamplerState &sampler)
 Set a sampler parameter on the shader instance. More...
 
MStatus setArrayParameter (const MString &parameterName, const bool *values, unsigned int count)
 Set a named, bool array parameter on the shader instance. More...
 
MStatus setArrayParameter (const MString &parameterName, const int *values, unsigned int count)
 Set a named, integer array parameter on the shader instance. More...
 
MStatus setArrayParameter (const MString &parameterName, const float *values, unsigned int count)
 Set a named, float array parameter on the shader instance. More...
 
MStatus setArrayParameter (const MString &parameterName, const MMatrix *values, unsigned int count)
 Set a named, matrix array parameter on the shader instance. More...
 
MStatus addInputFragment (const MString &fragmentName, const MString &outputName, const MString &inputName)
 Connect a fragment that has been registered with the fragment manager to an input on the existing MShaderInstance. More...
 
MStatus addOutputFragment (const MString &fragmentName, const MString &inputName)
 Connect a fragment that has been registered with the fragment manager to an output on the existing MShaderInstance. More...
 
MStatus bind (const MDrawContext &context) const
 Binds the shader instance to the draw context, so that it is the active shader. More...
 
unsigned int getPassCount (const MDrawContext &context, MStatus *status=NULL) const
 Returns the number of draw passes defined by the shader. More...
 
MStatus activatePass (const MDrawContext &context, unsigned int pass) const
 Activates the given pass of the shader. More...
 
MStatus unbind (const MDrawContext &context) const
 Unbinds the shader instance from the draw context. More...
 
MStatus updateParameters (const MDrawContext &context) const
 Updates the bound shader instance with the current parameter data. More...
 
bool isTransparent () const
 Return whether the shader will render with transparency. More...
 
MStatus setIsTransparent (bool value)
 Set whether the shader will render with transparency. More...
 
MShaderInstanceclone () const
 Clone the shader. More...
 
MShaderInstancecreateShaderInstanceWithColorManagementFragment (const MString &inputColorSpace)
 Return a new shader instance with Color Management fragment added, which is based on the callee. More...
 
MStatus requiredVertexBuffers (MVertexBufferDescriptorList &list) const
 Get the vertex buffer descriptors that describe the buffers required by a given shader instance. More...
 
int annotationAsInt (const MString &parameterName, const MString &annotationName, MStatus &status)
 Returns annotation value for a given parameter as integer. More...
 
float annotationAsFloat (const MString &parameterName, const MString &annotationName, MStatus &status)
 Returns annotation value for a given parameter as float. More...
 
MString annotationAsString (const MString &parameterName, const MString &annotationName, MStatus &status)
 Returns annotation value for a given parameter as MString. More...
 
MString parameterSemantic (const MString &parameterName, MStatus &status)
 Returns the semantic associated to a given parameter. More...
 
void * parameterDefaultValue (const MString &parameterName, MStatus &status)
 Returns the default value of a given parameter. More...
 
MString resourceName (const MString &parameterName, MStatus &status)
 Returns the resource name of a given texture parameter. More...
 
MString uiWidget (const MString &parameterName, MStatus &status)
 Returns the UI widget type associated with a given parameter. More...
 
MString uiName (const MString &parameterName, MStatus &uiName)
 Returns the UI name associated with a given parameter. More...
 
MStatus techniqueNames (MStringArray &techniqueNames) const
 Returns a list of the technique names for the effect. More...
 
int techniqueAnnotationAsInt (const MString &annotationName, MStatus &status)
 Returns the value of the current technique annotation as integer. More...
 
float techniqueAnnotationAsFloat (const MString &annotationName, MStatus &status)
 Returns the value of the current technique annotation as float. More...
 
MString techniqueAnnotationAsString (const MString &annotationName, MStatus &status)
 Returns the value of the current technique annotation as MString. More...
 
int passAnnotationAsInt (unsigned int pass, const MString &annotationName, MStatus &status)
 Returns the value of the current technique's pass annotation as int. More...
 
float passAnnotationAsFloat (unsigned int pass, const MString &annotationName, MStatus &status)
 Returns the value of the current technique's pass annotation as float. More...
 
MString passAnnotationAsString (unsigned int pass, const MString &annotationName, MStatus &status)
 Returns the value of the current technique's pass annotation as MString. More...
 
MStatus writeEffectSourceToFile (const MString &filePath) const
 Write the source of the final OGSFX/HLSL/CgFX effect to a specified file. More...
 

Static Public Member Functions

static const char * className ()
 Returns the name of this class. More...
 

Member Enumeration Documentation

Specifies parameter types.

Enumerator
kInvalid 

Invalid element type (default value)

kBoolean 

Boolean.

kInteger 

Signed 32-bit integer.

kFloat 

IEEE single precision floating point.

kFloat2 

IEEE single precision floating point (x2)

kFloat3 

IEEE single precision floating point (x3)

kFloat4 

IEEE single precision floating point (x4)

kFloat4x4Row 

IEEE single precision floating point row-major matrix (4x4)

kFloat4x4Col 

IEEE single precision floating point column-major matrix (4x4)

kTexture1 

1D texture

kTexture2 

2D texture

kTexture3 

3D texture

kTextureCube 

Cube texture.

kSampler 

Sampler.

Member Function Documentation

MShaderInstance::DrawCallback preDrawCallback ( ) const

Access the pre-draw callback function pointer set for the this shader instance.

Returns
The pre-draw callback function pointer or NULL if not set
MShaderInstance::DrawCallback postDrawCallback ( ) const

Access the post-draw callback function pointer set for the this shader instance.

Returns
The post-draw callback function pointer or NULL if not set
void parameterList ( MStringArray list) const

Get the names of all parameters that are settable on this shader instance.

Parameters
[out]listThe list to populate parameter names
+ Examples:
MShaderInstance::ParameterType parameterType ( const MString parameterName) const

Get the type of the named parameter, returns kInvalid if parameter is not found.

Parameters
[in]parameterNameName of the parameter to query
Returns
The type of the named parameter
+ Examples:
bool isArrayParameter ( const MString parameterName) const

Determine whether the named parameter is an array.

Parameters
[in]parameterNameName of the parameter to query
Returns
True if the named parameter is an array
+ Examples:
MString semantic ( const MString parameterName) const

Return the semantic for a named parameter.

Parameters
[in]parameterNameName of the parameter to query
Returns
Semantic string. String will be empty if there is no semantic.
MStatus setParameter ( const MString parameterName,
int  value 
)

Set a named, integer parameter on the shader instance.

Parameters
[in]parameterNameName of the parameter to set
[in]valueValue of the parameter
Returns
Status code
Status Codes:
MStatus setParameter ( const MString parameterName,
float  value 
)

Set a named, float parameter on the shader instance.

Parameters
[in]parameterNameName of the parameter to set
[in]valueValue of the parameter
Returns
Status code
Status Codes:
MStatus setParameter ( const MString parameterName,
const float *  value 
)

Set a named, float, float2, float3 or float4 parameter on the shader instance.

The floating point data stored in "value" will be interpreted based on the type of the named parameter. For example, for a parameter of type kFloat3, the data will be assumed to be an array containing three floats.

Parameters
[in]parameterNameName of the parameter to set
[in]valueValue of the parameter
Returns
Status code
Status Codes:
MStatus setParameter ( const MString parameterName,
const MFloatVector value 
)

Set a named, float, float2, float3 parameter on the shader instance.

The floating point data stored in "value" will be interpreted based on the type of the named parameter. For example, for a parameter of type kFloat3, the first 3 elements of the data will be set.

Parameters
[in]parameterNameName of the parameter to set
[in]valueValue of the parameter
Returns
Status code
Status Codes:
MStatus setParameter ( const MString parameterName,
const MMatrix value 
)

Set a named, matrix parameter on the shader instance.

Note that this method does not alter the matrix and it is up to the caller to set the values correctly depending on whether the parameter is row-major or column-major.

Parameters
[in]parameterNameName of the parameter to set
[in]valueValue of the parameter
Returns
Status code
Status Codes:
MStatus setParameter ( const MString parameterName,
const MFloatMatrix value 
)

Set a named, matrix parameter on the shader instance.

Note that this method does not alter the matrix and it is up to the caller to set the values correctly depending on whether the parameter is row-major or column-major.

Parameters
[in]parameterNameName of the parameter to set
[in]valueValue of the parameter
Returns
Status code
Status Codes:
MStatus setParameter ( const MString parameterName,
MTextureAssignment textureAssignment 
)

Set a texture parameter on the shader instance.

If the texture assignment contains a NULL value for texture then the shader parameter will be set to NULL.

Parameters
[in]parameterNameName of the parameter to set
[in]textureAssignmentTexture to assign
Returns
Status code
Status Codes:
MStatus setParameter ( const MString parameterName,
MRenderTargetAssignment targetAssignment 
)

Set a named, texture parameter on the shader instance to a render target.

If the render target assignment contains a NULL value then the shader parameter will be set to NULL.

Note, there is a significant performance penalty when binding MSAA targets (i.e. targets where multiSampleCount > 1).

Parameters
[in]parameterNameName of the parameter to set
[in]targetAssignmentRender target to assign
Returns
Status code
Status Codes:
MStatus setParameter ( const MString parameterName,
const MSamplerState sampler 
)

Set a sampler parameter on the shader instance.

Parameters
[in]parameterNameName of the parameter to set
[in]samplerSampler state to assign
Returns
Status code
Status Codes:
MStatus setArrayParameter ( const MString parameterName,
const bool *  values,
unsigned int  count 
)

Set a named, bool array parameter on the shader instance.

Parameters
[in]parameterNameName of the parameter to set
[in]valuesThe array of values to set
[in]countThe number of values in the array
Returns
Status code
Status Codes:
MStatus setArrayParameter ( const MString parameterName,
const int *  values,
unsigned int  count 
)

Set a named, integer array parameter on the shader instance.

Parameters
[in]parameterNameName of the parameter to set
[in]valuesThe array of values to set
[in]countThe number of values in the array
Returns
Status code
Status Codes:
MStatus setArrayParameter ( const MString parameterName,
const float *  values,
unsigned int  count 
)

Set a named, float array parameter on the shader instance.

This method is used for setting not just float arrays but float2, float3 and float4 array parameters as well. The floating point data stored in "values" will be interpreted based on the type of the named parameter. For example, for a parameter of type kFloat3, the data will be assumed to be a list of float-triples containing a total of "count" float-triples. So if "count" in this example is 5, that means the total number of raw floats is 3*5=15.

Parameters
[in]parameterNameName of the parameter to set
[in]valuesThe array of values to set
[in]countThe number of floats stored in the array divided by the dimension of the data
Returns
Status code
Status Codes:
MStatus setArrayParameter ( const MString parameterName,
const MMatrix values,
unsigned int  count 
)

Set a named, matrix array parameter on the shader instance.

Note that this method does not alter the matrices and it is up to the caller to set the values correctly depending on whether the parameter is row-major or column-major.

Parameters
[in]parameterNameName of the parameter to set
[in]valuesThe array of values to set
[in]countThe number of values in the array
Returns
Status code
Status Codes:
MStatus addInputFragment ( const MString fragmentName,
const MString outputName,
const MString inputName 
)

Connect a fragment that has been registered with the fragment manager to an input on the existing MShaderInstance.

Use this method to add shader instructions to an existing MShaderInstance. The code defined in the fragment will be compiled and executed on the GPU to compute the value for the input parameter.

Parameters
[in]fragmentNameThe name of a fragment that has been registered with the MFragmentManager.
[in]outputNameThe name of the output on the registered fragment to connect to.
[in]inputNameThe name of the input parameter on the MShaderInstance to connect to.
Returns
Status code
Status Codes:
  • MS::kSuccess The input was added correctly.
  • MS::kFailure The shader instance was not compatible with an input fragment. For instance it uses a file based effect which cannot be modified.
  • MS::kNotFound The fragment was not registered with the fragment manager.
  • MS::kUnknownParameter The input or output name does not exist to connect to or their types do not match.
MStatus addOutputFragment ( const MString fragmentName,
const MString inputName 
)

Connect a fragment that has been registered with the fragment manager to an output on the existing MShaderInstance.

The code defined in the fragment will be compiled and executed on the GPU to modify the value returned by the original shader. For example, use this method to add additional alpha or conditionals to the output color.

Parameters
[in]fragmentNameThe name of a fragment that has been registered with the MFragmentManager.
[in]inputNameThe name of the input parameter on the fragment to connect the shaders output to.
Returns
Status code
Status Codes:
  • MS::kSuccess The output was added correctly.
  • MS::kFailure The shader instance was not compatible with an output fragment. For instance it uses a file based effect which cannot be modified.
  • MS::kNotFound The fragment was not registered with the fragment manager.
  • MS::kUnknownParameter The input name does not exist to connect to.
MStatus bind ( const MDrawContext context) const

Binds the shader instance to the draw context, so that it is the active shader.

The typical call sequence is

bind() getPassCount() activatePass( 0 ) do drawing activatePass( 1 ) do drawing ... unbind()

Note that it is the plug-in author's responsibility to call unbind() at the appropriate time. Failing to do so may corrupt subsequent drawing.

Parameters
[in]contextThe current draw context
Returns
Status code
Status Codes:
  • MS::kSuccess The bind operation succeeded
  • MS::kFailure The shader instance or draw context was invalid, or it failed to bind. This can happen on first bind when an OGSFX effect causes GLSL compilation errors.
+ Examples:
unsigned int getPassCount ( const MDrawContext context,
MStatus status = NULL 
) const

Returns the number of draw passes defined by the shader.

Parameters
[in]contextThe current draw context
[out]statusStatus code
Returns
The pass count
Status Codes:
+ Examples:
MStatus activatePass ( const MDrawContext context,
unsigned int  pass 
) const

Activates the given pass of the shader.

Must be called between calls to bind() and unbind().

Parameters
[in]contextThe current draw context
[in]passThe index of the pass to activate
Returns
Status code
Status Codes:
+ Examples:
MStatus unbind ( const MDrawContext context) const

Unbinds the shader instance from the draw context.

Parameters
[in]contextThe current draw context
Returns
Status code
Status Codes:
+ Examples:
MStatus updateParameters ( const MDrawContext context) const

Updates the bound shader instance with the current parameter data.

This is useful in cases where the same shader instance is reusable but with different input parameters.

Must be called between calls to bind() and unbind().

Calling this method will invalidate any currently active pass. Must invoke activatePass() after calling this method.

Parameters
[in]contextThe current draw context
Returns
Status code
Status Codes:
+ Examples:
bool isTransparent ( ) const

Return whether the shader will render with transparency.

Returns
true if shader will render with transparency
MStatus setIsTransparent ( bool  value)

Set whether the shader will render with transparency.

Parameters
[in]valueValue to set
Returns
Status code
Status Codes:
+ Examples:
MShaderInstance * clone ( ) const

Clone the shader.

This will return a new MShaderInstance object which is identical to the existing shader. The new shader is completely independent of the original. Setting parameter values on either shader after calling clone will have no effect on the other.

Using clone can improve performance when many copies of the same shader are needed. When requesting MShaderInstance objects from MShaderManager the shader is recompiled for each request. The clone() method does not cause a recompilation.

Returns
A clone of this shader or NULL on failure
MShaderInstance * createShaderInstanceWithColorManagementFragment ( const MString inputColorSpace)

Return a new shader instance with Color Management fragment added, which is based on the callee.

The callee shader instance is the one used for rendering a render item with image(a MPxNode with image, etc.) The new shader is completely independent of the original shader. Setting parameter values on either shader after calling this function will have no effect on the other. The function won't keep a copy of input parameter.

When the returned new shader instance is no longer needed, MShaderManager::releaseShader() should be called to notify the shader manager that the caller is done with the shader.

Parameters
[in]inputColorSpaceThe color space the current image is in
Returns
A new shader instance or NULL on failure
MStatus requiredVertexBuffers ( MVertexBufferDescriptorList list) const

Get the vertex buffer descriptors that describe the buffers required by a given shader instance.

The descriptor elements will be appended to the passed list. It is the responsibility of the caller to clear the list if desired before calling this method using the MVertexBufferDescriptorList::clear() method.

Parameters
[out]listList of vertex buffer descriptors
Returns
MStatus::kSuccess if successful
const char * className ( )
static

Returns the name of this class.

Returns
Name of this class.
int annotationAsInt ( const MString parameterName,
const MString annotationName,
MStatus status 
)

Returns annotation value for a given parameter as integer.

Parameters
[in]parameterNameThe name of the parameter.
[in]annotationNameThe name of the annotation.
[in]statusReference to a status object to output operation status.
Returns
The annotation value as integer.
Status Codes:
  • MS::kSuccess The annotation value was found and returned correctly.
  • MS::kUnknownParameter The parameter is not a parameter of the instance or annotation is not defined for this parameter.
  • MS::kInvalidParameter The annotation value is not an integer, the returned value may still be valid.
  • MS::kNotFound An internal error prevented the parameter from being found.
float annotationAsFloat ( const MString parameterName,
const MString annotationName,
MStatus status 
)

Returns annotation value for a given parameter as float.

Parameters
[in]parameterNameThe name of the parameter.
[in]annotationNameThe name of the annotation.
[in]statusReference to a status object to output operation status.
Returns
The annotation value as float.
Status Codes:
  • MS::kSuccess The annotation value was found and returned correctly.
  • MS::kUnknownParameter The parameter is not a parameter of the instance or annotation is not defined for this parameter.
  • MS::kInvalidParameter The annotation value is not a float, the returned value may still be valid.
  • MS::kNotFound An internal error prevented the parameter from being found.
MString annotationAsString ( const MString parameterName,
const MString annotationName,
MStatus status 
)

Returns annotation value for a given parameter as MString.

Parameters
[in]parameterNameThe name of the parameter.
[in]annotationNameThe name of the annotation.
[in]statusReference to a status object to output operation status.
Returns
The annotation value as MString.
Status Codes:
  • MS::kSuccess The annotation value was found and returned correctly.
  • MS::kUnknownParameter The parameter is not a parameter of the instance or annotation is not defined for this parameter.
  • MS::kInvalidParameter The annotation value is not a string, the returned value may still be valid.
  • MS::kNotFound An internal error prevented the parameter from being found.
MString parameterSemantic ( const MString parameterName,
MStatus status 
)

Returns the semantic associated to a given parameter.

Parameters
[in]parameterNameThe name of the parameter.
[in]statusReference to a status object to output operation status.
Returns
The semantic name as a MString.
Status Codes:
void * parameterDefaultValue ( const MString parameterName,
MStatus status 
)

Returns the default value of a given parameter.

Parameters
[in]parameterNameThe name of the parameter.
[in]statusReference to a status object to output operation status.
Returns
A void pointer to the default value.
Status Codes:
MString resourceName ( const MString parameterName,
MStatus status 
)

Returns the resource name of a given texture parameter.

The resource name of a texture parameter can be specified in the effect file using the "ResourceName" annotation. It allows users to define a default texture using an external file. If no resource was defined for a texture, this function returns an empty string.

Parameters
[in]parameterNameThe name of the texture parameter.
[in]statusReference to a status object to output operation status.
Returns
The resource name as MString.
Status Codes:
MString uiWidget ( const MString parameterName,
MStatus status 
)

Returns the UI widget type associated with a given parameter.

The UI widget type can be specified in shader using the "UIWidget" annotation.

Parameters
[in]parameterNameThe name of the parameter.
[in]statusReference to a status object to output operation status.
Returns
The name of the UI widget type as MString.
Status Codes:
MString uiName ( const MString parameterName,
MStatus status 
)

Returns the UI name associated with a given parameter.

The UI name can be specified in shader using the "UIName" annotation.

Parameters
[in]parameterNameThe name of the parameter.
[in]statusReference to a status object to output operation status.
Returns
The name of the UI name as MString.
Status Codes:
MStatus techniqueNames ( MStringArray techniqueNames) const

Returns a list of the technique names for the effect.

Parameters
[out]techniqueNamesReturns the list of technique names for the effect.
Returns
Status code
Status Codes:
  • MS::kSuccess The techniques list was found and returned correctly.
  • MS::kFailure An internal error prevented the list of techniques from being retrieved.
int techniqueAnnotationAsInt ( const MString annotationName,
MStatus status 
)

Returns the value of the current technique annotation as integer.

Parameters
[in]annotationNameThe name of the technique annotation.
[in]statusReference to a status object to output operation status.
Returns
The technique annotation value as integer.
Status Codes:
  • MS::kSuccess The technique annotation was found and returned correctly.
  • MS::kNotFound The technique annotation was not found.
  • MS::kInvalidParameter The annotation value is not an integer, the returned value may still be valid.
  • MS::kFailure An internal error prevented the annotation from being found.
float techniqueAnnotationAsFloat ( const MString annotationName,
MStatus status 
)

Returns the value of the current technique annotation as float.

Parameters
[in]annotationNameThe name of the technique annotation.
[in]statusReference to a status object to output operation status.
Returns
The technique annotation value as float.
Status Codes:
  • MS::kSuccess The technique annotation was found and returned correctly.
  • MS::kNotFound The technique annotation was not found.
  • MS::kInvalidParameter The annotation value is not a float, the returned value may still be valid.
  • MS::kFailure An internal error prevented the annotation from being found.
MString techniqueAnnotationAsString ( const MString annotationName,
MStatus status 
)

Returns the value of the current technique annotation as MString.

Parameters
[in]annotationNameThe name of the technique annotation.
[in]statusReference to a status object to output operation status.
Returns
The technique annotation value as MString.
Status Codes:
  • MS::kSuccess The technique annotation was found and returned correctly.
  • MS::kNotFound The technique annotation was not found.
  • MS::kInvalidParameter The annotation value is not a string, the returned value may still be valid.
  • MS::kFailure An internal error prevented the annotation from being found.
int passAnnotationAsInt ( unsigned int  pass,
const MString annotationName,
MStatus status 
)

Returns the value of the current technique's pass annotation as int.

Parameters
[in]passThe index of the pass.
[in]annotationNameThe name of the pass annotation.
[in]statusReference to a status object to output operation status.
Returns
The pass annotation value as int.
Status Codes:
  • MS::kSuccess The pass annotation was found and returned correctly.
  • MS::kNotFound The pass annotation was not found.
  • MS::kInvalidParameter The annotation value is not an integer, the returned value may still be valid.
  • MS::kFailure An internal error prevented the parameter from being found.
float passAnnotationAsFloat ( unsigned int  pass,
const MString annotationName,
MStatus status 
)

Returns the value of the current technique's pass annotation as float.

Parameters
[in]passThe index of the pass.
[in]annotationNameThe name of the pass annotation.
[in]statusReference to a status object to output operation status.
Returns
The pass annotation value as float.
Status Codes:
MString passAnnotationAsString ( unsigned int  pass,
const MString annotationName,
MStatus status 
)

Returns the value of the current technique's pass annotation as MString.

Parameters
[in]passThe index of the pass.
[in]annotationNameThe name of the pass annotation.
[in]statusReference to a status object to output operation status.
Returns
The pass annotation value as MString.
Status Codes:
+ Examples:
MStatus writeEffectSourceToFile ( const MString filePath) const

Write the source of the final OGSFX/HLSL/CgFX effect to a specified file.

Use this for debugging to see how fragments are turned into the final effect for the current drawing API.

Note that the effect will not be written if the effect is not generated from shader fragments or any of the shader fragments is marked as hidden.

Parameters
[in]filePathPath of the file to write the effect source
Returns
Status code
Status Codes:

The documentation for this class was generated from the following files:
  • MShaderManager.h
  • MShaderManager.cpp