#include
<adskShader.h>
This class implements the same set of methods as the base ShaderHelper class for use with Lambertian materials.
ShaderParameters | The shader parameter structure. |
Public Member Functions |
|
LambertianShaderHelper (miState *pState, ShaderParameters *pParameters) | |
Constructor for lambertian shader helper.
|
|
~LambertianShaderHelper () | |
Deconstructor for lambertian shader helper.
|
|
void | setupMayaBumpMapping () |
Adjust normal for Maya's bump mapping.
|
|
miBoolean | computeHideSource () const |
Determine if source should be hidden.
|
|
void | computeTransparencyForShadow (miColor &pResTransp, miBoolean pHideSource) const |
Computes transparency for shadow rays.
|
|
void | evaluateParameters () |
Evaluates shader parameters necessary for
later computations. |
|
miColor | computeTransparency () const |
Computes transparency parameters for
non-shadow rays. |
|
miScalar | computeSpecularGlow () const |
Computes the specular glow parameters for
the shader. |
|
void | setASQWeight (MayabaseState *&MBS, BRDFComponent &bc, const miColor &pColor, const miColor &pTransparency, miScalar &pGlowIntensity) const |
Set the ASQ weight for this shader call.
|
|
miColor | computeAmbientResult (const miColor &pAmbientColor, const miColor &pColor) const |
Computes the ambient result color. |
|
miScalar | computeTranslucence (miScalar pDotNL, miVector &pLightDirection, miScalar pTranslucence, miScalar pTranslucenceFocus, miScalar pTranslucenceDepth, void *pLightBlindData) const |
Computes the translucence result for the
shader. |
|
float | computeDiffuseAreaLightFactor (miVector &pBumpNormal, void *pLightBlindData) const |
Computes the diffuse factor for area lights.
|
|
float | computeSpecularAreaLightFactor (miVector &pBumpNormal, void *pLightBlindData) const |
Computes the specular factor for area
lights. |
|
miColor | getReflectedColor () const |
Return the reflected color for this shader.
|
|
Public Attributes |
|
miState * | state |
ShaderParameters * | params |
LambertianShaderHelper< ShaderParameters >::LambertianShaderHelper | ( | miState * | pState, | |
ShaderParameters * | pParameters | |||
) | [inline] |
Constructor for lambertian shader helper.
This will be called once per evaluation of the main shading function for the shader. This stores the state and the parameters for use in various functions.
[in,out] | pState | A pointer to the mental ray state structure. |
[in] | pParameters | A pointer to the shader parameters. |
LambertianShaderHelper< ShaderParameters >::~LambertianShaderHelper | ( | ) | [inline] |
Deconstructor for lambertian shader helper.
This will be called once per evaluation of the main shading function for the shader.
void LambertianShaderHelper< ShaderParameters >::setupMayaBumpMapping | ( | ) | [inline] |
Adjust normal for Maya's bump mapping.
This function adjusts state->normal to account for bump mapping. Override it to change how bump mapping works.
miBoolean LambertianShaderHelper< ShaderParameters >::computeHideSource | ( | ) | const [inline] |
Determine if source should be hidden.
Most Maya shaders define the hideSource attribute to determine if the source geometry should be hidden (often used with glow). Override this to tell the main shading function whether or not the source should be hidden.
void LambertianShaderHelper< ShaderParameters >::computeTransparencyForShadow | ( | miColor & | pResTransp, | |
miBoolean | pHideSource | |||
) | const [inline] |
Computes transparency for shadow rays.
This function computes the transparency of the shader when hit by a shadow ray.
[out] | pResTransp | The resulting transparency. |
[in] | pHideSource | True if the source is hidden. |
void LambertianShaderHelper< ShaderParameters >::evaluateParameters | ( | ) | [inline] |
Evaluates shader parameters necessary for later computations.
This function is called after other initialization to give the helper a chance to evaluate any parameters necessary for later computations.
Reimplemented in SpecularShaderHelper< ShaderParameters >.
miColor LambertianShaderHelper< ShaderParameters >::computeTransparency | ( | ) | const [inline] |
Computes transparency parameters for non-shadow rays.
This function is called to evaluate the transparency parameters for the shader on non-shadow rays.
miScalar LambertianShaderHelper< ShaderParameters >::computeSpecularGlow | ( | ) | const [inline] |
Computes the specular glow parameters for the shader.
This function is called to evaluate any specular glow parameters to the shader for use in later computations.
void LambertianShaderHelper< ShaderParameters >::setASQWeight | ( | MayabaseState *& | MBS, | |
BRDFComponent & | bc, | |||
const miColor & | pColor, | |||
const miColor & | pTransparency, | |||
miScalar & | pGlowIntensity | |||
) | const [inline] |
Set the ASQ weight for this shader call.
This function adjusts the ASQ weight according to the light loop's impact on the final shader result.
[in,out] | MBS | The current Maya state. |
[in] | bc | BRDF component information. |
[in] | pColor | The diffuse color for the shader. |
[in] | pTransparency | The transparency for the shader. |
[in] | pGlowIntensity | The glow intensity for the shader. |
Reimplemented in SpecularShaderHelper< ShaderParameters >.
miColor LambertianShaderHelper< ShaderParameters >::computeAmbientResult | ( | const miColor & | pAmbientColor, | |
const miColor & | pColor | |||
) | const [inline] |
Computes the ambient result color.
This function computes the color returned in the ambient channel of the shader result structure.
[in] | pAmbientColor | The ambient color of the material. |
[in] | pColor | The diffuse color of the material. |
miScalar LambertianShaderHelper< ShaderParameters >::computeTranslucence | ( | miScalar | pDotNL, | |
miVector & | pLightDirection, | |||
miScalar | pTranslucence, | |||
miScalar | pTranslucenceFocus, | |||
miScalar | pTranslucenceDepth, | |||
void * | pLightBlindData | |||
) | const [inline] |
Computes the translucence result for the shader.
This function computes the translucence result for the shader given various parameters. This result is combined with the diffuse component to produce the diffuse result.
[in] | pDotNL | The dot product between the light vector and the normal. |
[in] | pLightDirection | The light vector. |
[in] | pTranslucence | The amount of translucence for the material. |
[in] | pTranslucenceFocus | The translucence focus for the material. |
[in] | pTranslucenceDepth | The translucence depth for the material. |
[in] | pLightBlindData | Custom light shader data. |
float LambertianShaderHelper< ShaderParameters >::computeDiffuseAreaLightFactor | ( | miVector & | pBumpNormal, | |
void * | pLightBlindData | |||
) | const [inline] |
Computes the diffuse factor for area lights.
This function computes the diffuse factor for area lights.
[in] | pBumpNormal | The normal after bump adjustments. |
[in] | pLightBlindData | Custom light shader data. |
float LambertianShaderHelper< ShaderParameters >::computeSpecularAreaLightFactor | ( | miVector & | pBumpNormal, | |
void * | pLightBlindData | |||
) | const [inline] |
Computes the specular factor for area lights.
This function computes the specular factor for area lights.
[in] | pBumpNormal | The normal after bump adjustments. |
[in] | pLightBlindData | Custom light shader data. |
miColor LambertianShaderHelper< ShaderParameters >::getReflectedColor | ( | ) | const [inline] |
Return the reflected color for this shader.
Return the reflected color for this shader.
Reimplemented in SpecularShaderHelper< ShaderParameters >.
miState* LambertianShaderHelper< ShaderParameters >:: state |
Pointer to the current mental ray state for this shader invocation.
ShaderParameters* LambertianShaderHelper< ShaderParameters >:: params |
Pointer to the shader parameters for this shader invocation.
Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |