- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions

# MLightParameterInformation Class Reference
OpenMayaRender - API module for rendering

This reference page is linked to from the following overview topics: Autodesk Maya 2014, Extension for Autodesk Maya 2013, Autodesk Maya 2013, 4.2 Lighting Interfaces.

Search for all occurrences

## Detailed Description

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.

Examples:

  hwPhongShader.cpp.

`#include <MDrawContext.h>`

List of all members.

## Public Types
enum | ParameterType { kInvalid, kBoolean, kInteger, kFloat, kFloat2, kFloat3, kFloat4, kFloat4x4Row, kFloat4x4Col, kTexture2, kSampler }
| 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 }
| 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.
ParameterType | parameterType (const MString &parameterName) const
| Get the type of the named parameter, returns kInvalid if parameter is not found.
StockParameterSemantic | parameterSemantic (const MString &parameterName) const
| Get the stock semantic for a named parameter.
void | parameterNames (StockParameterSemantic semantic, MStringArray &list) const
| Get the name of all parameters on the light which are tagged with the stock semantic.
unsigned int | arrayParameterCount (const MString &parameterName) const
| Return the array size of a parameter.
MStatus | getParameter (const MString &parameterName, MIntArray &value)
| Get a named boolean or integer parameter.
MStatus | getParameter (const MString &parameterName, MFloatArray &value)
| Get a named float parameter.
MStatus | getParameter (const MString &parameterName, MMatrix &value)
| Get a named matrix parameter.
MStatus | getParameter (const MString &parameterName, MSamplerStateDesc &samplerDesc)
| Get a description of a sampler parameter.
void * | getParameterTextureHandle (const MString &parameterName)
| Get a resource handle for a texture parameter.
MStatus | getParameter (const MString &parameterName, MTextureAssignment &value)
| Get a named texture parameter.
MStatus | getParameter (StockParameterSemantic semantic, MIntArray &value)
| Get a boolean or integer parameter by semantic.
MStatus | getParameter (StockParameterSemantic semantic, MFloatArray &value)
| Get a float parameter by semantic.
MStatus | getParameter (StockParameterSemantic semantic, MMatrix &value)
| Get a matrix parameter by semantic.
MStatus | getParameter (StockParameterSemantic semantic, MSamplerStateDesc &samplerDesc)
| Get a sampler parameter by semantic.
void * | getParameterTextureHandle (StockParameterSemantic semantic)
| Get a resource handle for a texture parameter by semantic.
MStatus | getParameter (StockParameterSemantic semantic, MTextureAssignment &value)
| Get a texture parameter by semantic.
MString | lightType () const
| Get the classification of the light node.
MDagPath | lightPath (MStatus *ReturnStatus=NULL) const
| Returns the DagPath to the scene light.
## Protected Member Functions
| ~MLightParameterInformation ()
| Destructor.

## Member Enumeration Documentation

enum ParameterType

Search for all occurrences

Specifies light parameter data types.

Enumerator:

  kInvalid | Invalid element type (default value) Search for all occurrences
  kBoolean | Boolean. Search for all occurrences
  kInteger | Signed 32-bit integer. Search for all occurrences
  kFloat | IEEE single precision floating point. Search for all occurrences
  kFloat2 | IEEE single precision floating point (x2) Search for all occurrences
  kFloat3 | IEEE single precision floating point (x3) Search for all occurrences
  kFloat4 | IEEE single precision floating point (x4) Search for all occurrences
  kFloat4x4Row | IEEE single precision floating point row-major matrix (4x4) Search for all occurrences
  kFloat4x4Col | IEEE single precision floating point column-major matrix (4x4) Search for all occurrences
  kTexture2 | 2D texture Search for all occurrences
  kSampler | Sampler. Search for all occurrences

enum StockParameterSemantic

Search for all occurrences

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.

Enumerator:

  kNoSemantic | No semantic. Search for all occurrences
  kLightEnabled | Light is enabled. Search for all occurrences
  kWorldPosition | World space position. Search for all occurrences
  kWorldDirection | World space direction. Search for all occurrences
  kIntensity | Intensity. Search for all occurrences
  kColor | Color. Search for all occurrences
  kEmitsDiffuse | Emits diffuse lighting. Search for all occurrences
  kEmitsSpecular | Emits specular lighting. Search for all occurrences
  kDecayRate | Decay rate (0=No Decay, 1=Linear, 2=Quadratic, 3=Cubic) Search for all occurrences
  kDropoff | Dropoff. Search for all occurrences
  kCosConeAngle | Cosine of the cone angle. Search for all occurrences
  kStartShadowParameters | Incoming irradiance. Also marks the beginning of enums for shadowing. Search for all occurrences
  kShadowMap | Shadow map. Search for all occurrences
  kShadowSamp | Shadow map sampler. Search for all occurrences
  kShadowBias | Shadow map bias. Search for all occurrences
  kShadowMapSize | Shadow map size. Search for all occurrences
  kShadowViewProj | Shadow map view projection matrix. Search for all occurrences
  kShadowColor | Shadow color. Search for all occurrences
  kGlobalShadowOn | Global toggle for whether shadows are enabled or not. Search for all occurrences
  kShadowOn | Local toggle per light for whether shadows are enabled or not. Search for all occurrences
  kShadowDirty | Indicates if the contents of the shadow map are out-of-date or uninitialized. Search for all occurrences

## Member Function Documentation

void parameterList | ( | MStringArray & | list | ) | const

Search for all occurrences

Get the names of all light parameters that are accessible.

Parameters:

  [out] | list | The list to populate parameter names

Examples:
  hwPhongShader.cpp.

MLightParameterInformation::ParameterType parameterType | ( | const MString & | parameterName | ) | const

Search for all occurrences

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

Parameters:

  [in] | parameterName | Name of the parameter to query

Returns:
  The type of the named parameter

Examples:
  hwPhongShader.cpp.

MLightParameterInformation::StockParameterSemantic parameterSemantic | ( | const MString & | parameterName | ) | const

Search for all occurrences

Get the stock semantic for a named parameter.

Parameters:

  [in] | parameterName | Name of the parameter to query

Returns:
  The semantic of the named parameter

Examples:
  hwPhongShader.cpp.

void parameterNames | ( | MLightParameterInformation::StockParameterSemantic | semantic,
|  | MStringArray & | list
| ) |  | const

Search for all occurrences

Get the name of all parameters on the light which are tagged with the stock semantic.

Parameters:

  [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

Search for all occurrences

Return the array size of a parameter.

If the parameter is not an array then a value of 0 is returned.

Parameters:

  [in] | parameterName | Name of the parameter to query

Returns:
  Array size of a parameter.

MStatus getParameter | ( | const MString & | parameterName,
|  | MIntArray & | value
| ) |  |

Search for all occurrences

Get a named boolean or integer parameter.

Parameters:

  [in] | parameterName | Name of the parameter to retrieve
  [out] | value | Value of the parameter

Returns:
  Status code

Status Codes:
  - MS::kSuccess The parameter was retrieved.
  - MS::kInvalidParameter The named parameter is not a boolean or integer parameter.
  - MS::kUnknownParameter The named parameter does not exist.
  - MS::kFailure An internal error prevented the parameter from being retrieved.

Examples:
  hwPhongShader.cpp.

MStatus getParameter | ( | const MString & | parameterName,
|  | MFloatArray & | value
| ) |  |

Search for all occurrences

Get a named float parameter.

Parameters:

  [in] | parameterName | Name of the parameter to retrieve
  [out] | value | Value of the parameter

Returns:
  Status code

Status Codes:
  - MS::kSuccess The parameter was retrieved.
  - MS::kInvalidParameter The named parameter is not a float parameter.
  - MS::kUnknownParameter The named parameter does not exist.
  - MS::kFailure An internal error prevented the parameter from being retrieved.

MStatus getParameter | ( | const MString & | parameterName,
|  | MMatrix & | value
| ) |  |

Search for all occurrences

Get a named matrix parameter.

Parameters:

  [in] | parameterName | Name of the parameter to retrieve
  [out] | value | Value of the parameter

Returns:
  Status code

Status Codes:
  - MS::kSuccess The parameter was retrieved.
  - MS::kInvalidParameter The named parameter is not a float parameter.
  - MS::kUnknownParameter The named parameter does not exist.
  - MS::kFailure An internal error prevented the parameter from being retrieved.

MStatus getParameter | ( | const MString & | parameterName,
|  | MSamplerStateDesc & | samplerDesc
| ) |  |

Search for all occurrences

Get a description of a sampler parameter.

Parameters:

  [in] | parameterName | Name of the parameter to retrieve
  [out] | samplerDesc | Sampler state description retrieved

Returns:
  Status code

Status Codes:
  - MS::kSuccess The parameter was retrieved.
  - MS::kInvalidParameter The named parameter is not a sampler parameter.
  - MS::kUnknownParameter The named parameter is not an existing parameter.
  - MS::kFailure An internal error prevented the parameter from being retrieved.

void * getParameterTextureHandle | ( | const MString & | parameterName | ) |

Search for all occurrences

Get a resource handle for a texture parameter.

Parameters:

  [in] | parameterName | Name of the parameter to query

Returns:
  Resource handle for a texture parameter

Examples:
  hwPhongShader.cpp.

MStatus getParameter | ( | const MString & | parameterName,
|  | MHWRender::MTextureAssignment & | value
| ) |  |

Search for all occurrences

Get a named texture parameter.

Parameters:

  [in] | parameterName | Name of the parameter to query
  [out] | value | Value of the parameter

Returns:
  Status code

Status Codes:
  - MS::kSuccess The parameter was retrieved.
  - MS::kInvalidParameter The named parameter is not a texture parameter.
  - MS::kUnknownParameter The named parameter does not exist.
  - MS::kFailure An internal error prevented the parameter from being retrieved.

MStatus getParameter | ( | MLightParameterInformation::StockParameterSemantic | semantic,
|  | MIntArray & | value
| ) |  |

Search for all occurrences

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.

Parameters:

  [in] | semantic | Semantic of the parameter to retrieve
  [out] | value | Value of the parameter

Returns:
  Status code

Status Codes:
  - MS::kSuccess The parameter was retrieved.
  - MS::kInvalidParameter No parameter for the semantic is a boolean or integer parameter.
  - MS::kUnknownParameter No parameter matching the semantic exists.
  - MS::kFailure An internal error prevented the parameter from being retrieved.

MStatus getParameter | ( | MLightParameterInformation::StockParameterSemantic | semantic,
|  | MFloatArray & | value
| ) |  |

Search for all occurrences

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.

Parameters:

  [in] | semantic | Semantic of the parameter to retrieve
  [out] | value | Value of the parameter

Returns:
  Status code

Status Codes:
  - MS::kSuccess The parameter was retrieved.
  - MS::kInvalidParameter No parameter for the semantic is a float parameter.
  - MS::kUnknownParameter No parameter matching the semantic exists.
  - MS::kFailure An internal error prevented the parameter from being retrieved.

MStatus getParameter | ( | MLightParameterInformation::StockParameterSemantic | semantic,
|  | MMatrix & | value
| ) |  |

Search for all occurrences

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.

Parameters:

  [in] | semantic | Semantic of the parameter to retrieve
  [out] | value | Value of the parameter

Returns:
  Status code

Status Codes:
  - MS::kSuccess The parameter was retrieved.
  - MS::kInvalidParameter No parameter for the semantic is a matrix parameter.
  - MS::kUnknownParameter No parameter matching the semantic exists.
  - MS::kFailure An internal error prevented the parameter from being retrieved.

MStatus getParameter | ( | MLightParameterInformation::StockParameterSemantic | semantic,
|  | MSamplerStateDesc & | samplerDesc
| ) |  |

Search for all occurrences

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.

Parameters:

  [in] | semantic | Semantic of the parameter to retrieve
  [out] | samplerDesc | Value of the parameter

Returns:
  Status code

Status Codes:
  - MS::kSuccess The parameter was retrieved.
  - MS::kInvalidParameter No parameter for the semantic is a sampler parameter.
  - MS::kUnknownParameter No parameter matching the semantic exists.
  - MS::kFailure An internal error prevented the parameter from being retrieved.

void * getParameterTextureHandle | ( | MLightParameterInformation::StockParameterSemantic | semantic | ) |

Search for all occurrences

Get a resource handle for a texture parameter by semantic.

Parameters:

  [in] | semantic | Semantic of the parameter to retrieve

Returns:
  Resource handle for a texture parameter

MStatus getParameter | ( | MLightParameterInformation::StockParameterSemantic | semantic,
|  | MHWRender::MTextureAssignment & | value
| ) |  |

Search for all occurrences

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.

Parameters:

  [in] | semantic | Semantic of the parameter to retrieve
  [out] | value | Value of the parameter

Returns:
  Status code

Status Codes:
  - MS::kSuccess The parameter was retrieved.
  - MS::kInvalidParameter No parameter for the semantic is a texture parameter.
  - MS::kUnknownParameter No parameter matching the semantic exists.
  - MS::kFailure An internal error prevented the parameter from being retrieved.

MString lightType | ( |  | ) | const

Search for all occurrences

Get the classification of the light node.

Returns:
  Classification

- ambientLight Ambient Light
- areaLight Area Light
- directionalLight Directional Light
- pointLight Point Light
- spotLight Spot Light
- volumeLight Volume Light

MDagPath lightPath | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the DagPath to the scene light.

Will return an unitialized DagPath for default lights.

Parameters:

  [out] | ReturnStatus | Status code.

Returns:
  An MDagPath that references the object to which the Function Set is attached. If the function set is not attached to a dag path an uninitialized MDagPath will be returned.

Status Codes:
  - MS::kSuccess Success
  - MS::kFailure Function set does not have a valid object

MLightParameterInformation MLightParameterInformation MLightParameterInformation MLightParameterInformation MLightParameterInformation MLightParameterInformation MLightParameterInformation MLightParameterInformation MLightParameterInformation MLightParameterInformation
MLightParameterInformation MLightParameterInformation MLightParameterInformation MLightParameterInformation MLightParameterInformation MLightParameterInformation MLightParameterInformation MLightParameterInformation MLightParameterInformation MLightParameterInformation