#include <MRenderParameters.h>
Class which defines a set of render parameters.
Public Types | |
enum | ParameterType { kInvalid, kBoolean, kInteger, kFloat, kFloat2, kFloat3, kFloat4, kFloat4x4Row, kFloat4x4Col, kTexture1, kTexture2, kTexture3, kTextureCube, kSampler, kRenderTarget, kString } |
Specifies parameter types. More... | |
Public Member Functions | |
MRenderParameters () | |
Constructor. | |
MRenderParameters (void *) | |
Constructor (private) | |
MRenderParameters (const MRenderParameters ©) | |
Copy Constructor. More... | |
virtual | ~MRenderParameters () |
Destructor (virtual) | |
MRenderParameters & | operator= (const MRenderParameters &other) |
Operator overload (=) More... | |
void | parameterList (MStringArray &list) const |
Get the names of all parameters that are settable on this instance. More... | |
ParameterType | parameterType (const MString ¶meterName) const |
Get the type of the named parameter, returns kInvalid if parameter is not found. More... | |
bool | isArrayParameter (const MString ¶meterName) const |
Determine whether the named parameter is an array. More... | |
MString | semantic (const MString ¶meterName) const |
Return the semantic for a named parameter. More... | |
MStatus | setParameter (const MString ¶meterName, bool value) |
Set a named, boolean parameter on this instance. More... | |
MStatus | setParameter (const MString ¶meterName, int value) |
Set a named, integer parameter on this instance. More... | |
MStatus | setParameter (const MString ¶meterName, float value) |
Set a named, float parameter on this instance. More... | |
MStatus | setParameter (const MString ¶meterName, const float *value) |
Set a named, float, float2, float3 or float4 parameter on this instance. More... | |
MStatus | setParameter (const MString ¶meterName, const MFloatVector &value) |
Set a named, float, float2, float3 parameter on this instance. More... | |
MStatus | setParameter (const MString ¶meterName, const MMatrix &value) |
Set a named, matrix parameter on this instance. More... | |
MStatus | setParameter (const MString ¶meterName, const MFloatMatrix &value) |
Set a named, matrix parameter on this instance. More... | |
MStatus | setParameter (const MString ¶meterName, MTextureAssignment &textureAssignment) |
Set a texture parameter on this instance. More... | |
MStatus | setParameter (const MString ¶meterName, MRenderTargetAssignment &targetAssignment) |
Set a named, texture parameter on this instance to a render target. More... | |
MStatus | setParameter (const MString ¶meterName, const MSamplerState &sampler) |
Set a sampler parameter on this instance. More... | |
MStatus | setParameter (const MString ¶meterName, const MString &str) |
Set a named, string parameter on this instance. More... | |
MStatus | setArrayParameter (const MString ¶meterName, const bool *values, unsigned int count) |
Set a named, bool array parameter on this instance. More... | |
MStatus | setArrayParameter (const MString ¶meterName, const int *values, unsigned int count) |
Set a named, integer array parameter on this instance. More... | |
MStatus | setArrayParameter (const MString ¶meterName, const float *values, unsigned int count) |
Set a named, float array parameter on this instance. More... | |
MStatus | setArrayParameter (const MString ¶meterName, const MMatrix *values, unsigned int count) |
Set a named, matrix array parameter on this instance. More... | |
MStatus | setArrayParameter (const MString ¶meterName, const MString *values, unsigned int count) |
Set a named, integer array parameter on this instance. More... | |
MStatus | getParameter (const MString ¶meterName, bool &value) |
Get a named boolean parameter. More... | |
MStatus | getParameter (const MString ¶meterName, int &value) |
Get a named int parameter. More... | |
MStatus | getParameter (const MString ¶meterName, float &value) |
Get a named float parameter. More... | |
MStatus | getParameter (const MString ¶meterName, float *&value) |
Get a named float pointer parameter. More... | |
MStatus | getParameter (const MString ¶meterName, MFloatVector &value) |
Get a named float vector parameter. More... | |
MStatus | getParameter (const MString ¶meterName, MMatrix &value) |
Get a named matrix parameter. More... | |
MStatus | getParameter (const MString ¶meterName, MFloatMatrix &value) |
Get a named float matrix parameter. More... | |
MStatus | getParameter (const MString ¶meterName, MTextureAssignment &textureAssignment) |
Get a named texture parameter. More... | |
MStatus | getParameter (const MString ¶meterName, MRenderTargetAssignment &targetAssignment) |
Get a named target parameter. More... | |
MStatus | getParameter (const MString ¶meterName, MSamplerStateDesc &samplerDesc) |
Get a named sampler state parameter. More... | |
MStatus | getParameter (const MString ¶meterName, MString &str) |
Get a named string parameter. More... | |
MStatus | getParameter (const MString ¶meterName, MIntArray &values) |
Get a named int array parameter. More... | |
MStatus | getParameter (const MString ¶meterName, MFloatArray &values) |
Get a named float array parameter. More... | |
MStatus | getParameter (const MString ¶meterName, MMatrixArray &values) |
Get a named matrix array parameter. More... | |
MStatus | getParameter (const MString ¶meterName, MStringArray &values) |
Get a named string array parameter. More... | |
enum ParameterType |
Specifies parameter types.
MRenderParameters | ( | const MRenderParameters & | copy | ) |
Copy Constructor.
[in] | copy | The data to copy |
MRenderParameters & operator= | ( | const MRenderParameters & | other | ) |
Operator overload (=)
[in] | other | The MRenderParameters to compare against. |
void parameterList | ( | MStringArray & | list | ) | const |
Get the names of all parameters that are settable on this instance.
[out] | list | The list to populate parameter names |
MRenderParameters::ParameterType parameterType | ( | const MString & | parameterName | ) | const |
Get the type of the named parameter, returns kInvalid if parameter is not found.
[in] | parameterName | Name of the parameter to query |
bool isArrayParameter | ( | const MString & | parameterName | ) | const |
Determine whether the named parameter is an array.
[in] | parameterName | Name of the parameter to query |
Return the semantic for a named parameter.
[in] | parameterName | Name of the parameter to query |
Set a named, boolean parameter on this instance.
[in] | parameterName | Name of the parameter to set |
[in] | value | Value of the parameter |
Set a named, integer parameter on this instance.
[in] | parameterName | Name of the parameter to set |
[in] | value | Value of the parameter |
Set a named, float parameter on this instance.
[in] | parameterName | Name of the parameter to set |
[in] | value | Value of the parameter |
Set a named, float, float2, float3 or float4 parameter on this 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.
[in] | parameterName | Name of the parameter to set |
[in] | value | Value of the parameter |
MStatus setParameter | ( | const MString & | parameterName, |
const MFloatVector & | value | ||
) |
Set a named, float, float2, float3 parameter on this 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.
[in] | parameterName | Name of the parameter to set |
[in] | value | Value of the parameter |
Set a named, matrix parameter on this 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.
[in] | parameterName | Name of the parameter to set |
[in] | value | Value of the parameter |
MStatus setParameter | ( | const MString & | parameterName, |
const MFloatMatrix & | value | ||
) |
Set a named, matrix parameter on this 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.
[in] | parameterName | Name of the parameter to set |
[in] | value | Value of the parameter |
MStatus setParameter | ( | const MString & | parameterName, |
MTextureAssignment & | textureAssignment | ||
) |
Set a texture parameter on this instance.
If the texture assignment contains a NULL value for texture then the shader parameter will be set to NULL.
[in] | parameterName | Name of the parameter to set |
[in] | textureAssignment | Texture to assign |
MStatus setParameter | ( | const MString & | parameterName, |
MRenderTargetAssignment & | targetAssignment | ||
) |
Set a named, texture parameter on this 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).
[in] | parameterName | Name of the parameter to set |
[in] | targetAssignment | Render target to assign |
MStatus setParameter | ( | const MString & | parameterName, |
const MSamplerState & | sampler | ||
) |
Set a sampler parameter on this instance.
[in] | parameterName | Name of the parameter to set |
[in] | sampler | Sampler state to assign |
Set a named, string parameter on this instance.
[in] | parameterName | Name of the parameter to set |
[in] | value | Value of the parameter |
MStatus setArrayParameter | ( | const MString & | parameterName, |
const bool * | values, | ||
unsigned int | count | ||
) |
Set a named, bool array parameter on this instance.
[in] | parameterName | Name of the parameter to set |
[in] | values | The array of values to set |
[in] | count | The number of values in the array |
Set a named, integer array parameter on this instance.
[in] | parameterName | Name of the parameter to set |
[in] | values | The array of values to set |
[in] | count | The number of values in the array |
MStatus setArrayParameter | ( | const MString & | parameterName, |
const float * | values, | ||
unsigned int | count | ||
) |
Set a named, float array parameter on this 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.
[in] | parameterName | Name of the parameter to set |
[in] | values | The array of values to set |
[in] | count | The number of floats stored in the array divided by the dimension of the data |
MStatus setArrayParameter | ( | const MString & | parameterName, |
const MMatrix * | values, | ||
unsigned int | count | ||
) |
Set a named, matrix array parameter on this 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.
[in] | parameterName | Name of the parameter to set |
[in] | values | The array of values to set |
[in] | count | The number of values in the array |
MStatus setArrayParameter | ( | const MString & | parameterName, |
const MString * | values, | ||
unsigned int | count | ||
) |
Set a named, integer array parameter on this instance.
[in] | parameterName | Name of the parameter to set |
[in] | values | The array of values to set |
[in] | count | The number of values in the array |
Get a named boolean parameter.
[in] | parameterName | Name of the parameter to query |
[out] | value | Value of the parameter |
Get a named int parameter.
[in] | parameterName | Name of the parameter to query |
[out] | value | Value of the parameter |
Get a named float parameter.
[in] | parameterName | Name of the parameter to query |
[out] | value | Value of the parameter |
Get a named float pointer parameter.
[in] | parameterName | Name of the parameter to query |
[out] | value | Value of the parameter |
MStatus getParameter | ( | const MString & | parameterName, |
MFloatVector & | value | ||
) |
Get a named float vector parameter.
[in] | parameterName | Name of the parameter to query |
[out] | value | Value of the parameter |
Get a named matrix parameter.
[in] | parameterName | Name of the parameter to query |
[out] | value | Value of the parameter |
MStatus getParameter | ( | const MString & | parameterName, |
MFloatMatrix & | value | ||
) |
Get a named float matrix parameter.
[in] | parameterName | Name of the parameter to query |
[out] | value | Value of the parameter |
MStatus getParameter | ( | const MString & | parameterName, |
MTextureAssignment & | textureAssignment | ||
) |
Get a named texture parameter.
[in] | parameterName | Name of the parameter to query |
[out] | textureAssignment | Value of the parameter |
MStatus getParameter | ( | const MString & | parameterName, |
MRenderTargetAssignment & | targetAssignment | ||
) |
Get a named target parameter.
[in] | parameterName | Name of the parameter to query |
[out] | targetAssignment | Value of the parameter |
MStatus getParameter | ( | const MString & | parameterName, |
MSamplerStateDesc & | samplerDesc | ||
) |
Get a named sampler state parameter.
[in] | parameterName | Name of the parameter to query |
[out] | samplerDesc | Value of the parameter |
Get a named string parameter.
[in] | parameterName | Name of the parameter to query |
[out] | value | Value of the parameter |
Get a named int array parameter.
[in] | parameterName | Name of the parameter to query |
[out] | values | Value of the parameter |
MStatus getParameter | ( | const MString & | parameterName, |
MFloatArray & | values | ||
) |
Get a named float array parameter.
[in] | parameterName | Name of the parameter to query |
[out] | values | Value of the parameter |
MStatus getParameter | ( | const MString & | parameterName, |
MMatrixArray & | values | ||
) |
Get a named matrix array parameter.
[in] | parameterName | Name of the parameter to query |
[out] | values | Value of the parameter |
MStatus getParameter | ( | const MString & | parameterName, |
MStringArray & | values | ||
) |
Get a named string array parameter.
[in] | parameterName | Name of the parameter to query |
[out] | values | Value of the parameter |