MLightParameterInformation Class Reference


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

Specifies light parameter data 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)

kTexture2 

2D texture

kSampler 

Sampler.

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.

kLightEnabled 

Light is enabled.

kWorldPosition 

World space position.

kWorldDirection 

World space direction.

kIntensity 

Intensity.

kColor 

Color.

kEmitsDiffuse 

Emits diffuse lighting.

kEmitsSpecular 

Emits specular lighting.

kDecayRate 

Decay rate (0=No Decay, 1=Linear, 2=Quadratic, 3=Cubic)

kDropoff 

Dropoff.

kCosConeAngle 

Cosine of the cone angle.

kStartShadowParameters 

Incoming irradiance. Also marks the beginning of enums for shadowing.

kShadowMap 

Shadow map.

kShadowSamp 

Shadow map sampler.

kShadowBias 

Shadow map bias.

kShadowMapSize 

Shadow map size.

kShadowViewProj 

Shadow map view projection matrix.

kShadowColor 

Shadow color.

kGlobalShadowOn 

Global toggle for whether shadows are enabled or not.

kShadowOn 

Local toggle per light for whether shadows are enabled or not.


Member Function Documentation

void parameterList ( MStringArray list) const

Get the names of all light parameters that are accessible.

Parameters:
[out]listThe 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.

Parameters:
[in]parameterNameName of the parameter to query
Returns:
The type of the named parameter
MLightParameterInformation::StockParameterSemantic parameterSemantic ( const MString parameterName) const

Get the stock semantic for a named parameter.

Parameters:
[in]parameterNameName of the parameter to query
Returns:
The semantic of the named parameter
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.

Parameters:
[in]parameterNameName of the parameter to query
Returns:
Array size of a parameter.
MStatus getParameter ( const MString parameterName,
MIntArray value 
)

Get a named, boolean or integer parameter.

Parameters:
[in]parameterNameName of the parameter to retrieve
[out]valueValue of the parameter
Returns:
Status code
Status Codes:
MStatus getParameter ( const MString parameterName,
MFloatArray value 
)

Get a named, float parameter.

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

Get a named, matrix parameter.

Parameters:
[in]parameterNameName of the parameter to retrieve
[out]valueValue of the parameter
Returns:
Status code
Status Codes:
MStatus getParameter ( const MString parameterName,
MSamplerStateDesc samplerDesc 
)

Get a description of a sampler parameter.

Parameters:
[in]parameterNameName of the parameter to retrieve
[out]samplerDescSampler state description retrieved
Returns:
Status code
Status Codes:
void * getParameterTextureHandle ( const MString parameterName)

Get a resource handle for a texture parameter.

Parameters:
[in]parameterNameName of the parameter to query
Returns:
Resource handle for a texture parameter
MStatus getParameter ( const MString parameterName,
MHWRender::MTextureAssignment value 
)

Get a named texture parameter.

Parameters:
[in]parameterNameName of the parameter to query
[out]valueValue of the parameter
Returns:
Status code
Status Codes:

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