C++ API Reference
|
A class for providing lighting information that may be used with Viewport 2.0. More...
#include <MDrawContext.h>
Public Types | |
enum | ParameterType { kInvalid, kBoolean, kInteger, kFloat, kFloat2, kFloat3, kFloat4, kFloat4x4Row, kFloat4x4Col, kTexture2, kSampler, kTextureCube } |
Specifies light parameter data types. More... | |
enum | StockParameterSemantic { kNoSemantic, kLightEnabled, kWorldPosition, kWorldDirection, kIntensity, kColor, kEmitsDiffuse, kEmitsSpecular, kDecayRate, kDropoff, kCosConeAngle, kStartShadowParameters , kShadowMap, kShadowSamp, kShadowBias, kShadowMapSize, kShadowViewProj, kShadowColor, kGlobalShadowOn, kShadowOn, kShadowDirty, kDepthRange } |
Specifies semantic meanings for predefined names for common or "stock" light parameters. More... | |
Public Member Functions | |
void | parameterList (MStringArray &list) const |
Get the names of all light parameters that are accessible. More... | |
ParameterType | parameterType (const MString ¶meterName) const |
Get the type of the named parameter, returns kInvalid if parameter is not found. More... | |
StockParameterSemantic | parameterSemantic (const MString ¶meterName) const |
Get the stock semantic for a named parameter. More... | |
void | parameterNames (StockParameterSemantic semantic, MStringArray &list) const |
Get the name of all parameters on the light which are tagged with the stock semantic. More... | |
unsigned int | arrayParameterCount (const MString ¶meterName) const |
Return the array size of a parameter. More... | |
MStatus | getParameter (const MString ¶meterName, MIntArray &value) |
Get a named boolean or integer parameter. More... | |
MStatus | getParameter (const MString ¶meterName, MFloatArray &value) |
Get a named float parameter. More... | |
MStatus | getParameter (const MString ¶meterName, MMatrix &value) |
Get a named matrix parameter. More... | |
MStatus | getParameter (const MString ¶meterName, MSamplerStateDesc &samplerDesc) |
Get a description of a sampler parameter. More... | |
void * | getParameterTextureHandle (const MString ¶meterName) |
Get a resource handle for a texture parameter. More... | |
MStatus | getParameter (const MString ¶meterName, MTextureAssignment &value) |
Get a named texture parameter. More... | |
MStatus | getParameter (StockParameterSemantic semantic, MIntArray &value) |
Get a boolean or integer parameter by semantic. More... | |
MStatus | getParameter (StockParameterSemantic semantic, MFloatArray &value) |
Get a float parameter by semantic. More... | |
MStatus | getParameter (StockParameterSemantic semantic, MMatrix &value) |
Get a matrix parameter by semantic. More... | |
MStatus | getParameter (StockParameterSemantic semantic, MSamplerStateDesc &samplerDesc) |
Get a sampler parameter by semantic. More... | |
void * | getParameterTextureHandle (StockParameterSemantic semantic) |
Get a resource handle for a texture parameter by semantic. More... | |
MStatus | getParameter (StockParameterSemantic semantic, MTextureAssignment &value) |
Get a texture parameter by semantic. More... | |
MString | lightType () const |
Get the classification of the light node. More... | |
MDagPath | lightPath (MStatus *ReturnStatus=NULL) const |
Returns the DagPath to the scene light. More... | |
Protected Member Functions | |
~MLightParameterInformation () | |
Destructor. | |
A class for providing lighting information that may be used with Viewport 2.0.
This class allows for access to various per-light information accessible via the MDrawContext class in Viewport 2.0.
enum ParameterType |
Specifies light parameter data types.
Specifies semantic meanings for predefined names for common or "stock" light parameters.
The semantic is provided to aid in the determination of the appropriate mapping of parameter values to programmable shader or fixed function lighting inputs.
Note that not all parameters exist on all lights so there may be no match for a given stock name. For example a directional light will have no position parameter.
void parameterList | ( | MStringArray & | list | ) | const |
Get the names of all light parameters that are accessible.
[out] | list | The list to populate parameter names |
MLightParameterInformation::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 |
MLightParameterInformation::StockParameterSemantic parameterSemantic | ( | const MString & | parameterName | ) | const |
Get the stock semantic for a named parameter.
[in] | parameterName | Name of the parameter to query |
void parameterNames | ( | MLightParameterInformation::StockParameterSemantic | semantic, |
MStringArray & | list | ||
) | const |
Get the name of all parameters on the light which are tagged with the stock semantic.
[in] | semantic | The semantic to query |
[out] | list | The list to populate with parameter names, will be empty if light has no parameters matching semantic. |
unsigned int arrayParameterCount | ( | const MString & | parameterName | ) | const |
Return the array size of a parameter.
If the parameter is not an array then a value of 0 is returned.
[in] | parameterName | Name of the parameter to query |
Get a named boolean or integer parameter.
[in] | parameterName | Name of the parameter to retrieve |
[out] | value | Value of the parameter |
MStatus getParameter | ( | const MString & | parameterName, |
MFloatArray & | value | ||
) |
Get a named float parameter.
[in] | parameterName | Name of the parameter to retrieve |
[out] | value | Value of the parameter |
Get a named matrix parameter.
[in] | parameterName | Name of the parameter to retrieve |
[out] | value | Value of the parameter |
MStatus getParameter | ( | const MString & | parameterName, |
MSamplerStateDesc & | samplerDesc | ||
) |
Get a description of a sampler parameter.
[in] | parameterName | Name of the parameter to retrieve |
[out] | samplerDesc | Sampler state description retrieved |
void * getParameterTextureHandle | ( | const MString & | parameterName | ) |
Get a resource handle for a texture parameter.
[in] | parameterName | Name of the parameter to query |
MStatus getParameter | ( | const MString & | parameterName, |
MHWRender::MTextureAssignment & | value | ||
) |
Get a named texture parameter.
[in] | parameterName | Name of the parameter to query |
[out] | value | Value of the parameter |
MStatus getParameter | ( | MLightParameterInformation::StockParameterSemantic | semantic, |
MIntArray & | value | ||
) |
Get a boolean or integer parameter by semantic.
If more than one parameter matches the semantic, the value of the first matching boolean or integer parameter found will be returned.
[in] | semantic | Semantic of the parameter to retrieve |
[out] | value | Value of the parameter |
MStatus getParameter | ( | MLightParameterInformation::StockParameterSemantic | semantic, |
MFloatArray & | value | ||
) |
Get a float parameter by semantic.
If more than one parameter matches the semantic, the value of the first matching float parameter found will be returned.
[in] | semantic | Semantic of the parameter to retrieve |
[out] | value | Value of the parameter |
MStatus getParameter | ( | MLightParameterInformation::StockParameterSemantic | semantic, |
MMatrix & | value | ||
) |
Get a matrix parameter by semantic.
If more than one parameter matches the semantic, the value of the first matching matrix parameter found will be returned.
[in] | semantic | Semantic of the parameter to retrieve |
[out] | value | Value of the parameter |
MStatus getParameter | ( | MLightParameterInformation::StockParameterSemantic | semantic, |
MSamplerStateDesc & | samplerDesc | ||
) |
Get a sampler parameter by semantic.
If more than one parameter matches the semantic, the value of the first matching sampler parameter found will be returned.
[in] | semantic | Semantic of the parameter to retrieve |
[out] | samplerDesc | Value of the parameter |
void * getParameterTextureHandle | ( | MLightParameterInformation::StockParameterSemantic | semantic | ) |
Get a resource handle for a texture parameter by semantic.
[in] | semantic | Semantic of the parameter to retrieve |
MStatus getParameter | ( | MLightParameterInformation::StockParameterSemantic | semantic, |
MHWRender::MTextureAssignment & | value | ||
) |
Get a texture parameter by semantic.
If more than one parameter matches the semantic, the value of the first matching texture parameter found will be returned.
[in] | semantic | Semantic of the parameter to retrieve |
[out] | value | Value of the parameter |
MString lightType | ( | ) | const |
Get the classification of the light node.
Returns the DagPath to the scene light.
Will return an unitialized DagPath for default lights.
[out] | ReturnStatus | Status code. |