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

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions

# MLightParameterInformation Class Reference

# OpenMayaRender - API module for rendering

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.

`#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 }
| 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.
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.
## 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

## 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

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

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

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.

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

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.

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