#include
<adskShader.h>
This class has several methods which can be used to override the default shading behaviour.
ShaderParameters | The shader parameter structure. |
Public Member Functions |
|
ShaderHelper (miState *pState, ShaderParameters *pParameters) | |
Constructor for shader helper. |
|
~ShaderHelper () | |
Deconstructor for shader helper. |
|
void | setupMayaBumpMapping () const |
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.
|
ShaderHelper< ShaderParameters >::ShaderHelper | ( | miState * | pState, | |
ShaderParameters * | pParameters | |||
) | [inline] |
Constructor for shader helper.
This will be called once per evaluation of the main shading function for the shader.
[in,out] | pState | A pointer to the mental ray state structure. |
[in] | pParameters | A pointer to the shader parameters. |
ShaderHelper< ShaderParameters >::~ShaderHelper | ( | ) | [inline] |
Deconstructor for shader helper.
This will be called once per evaluation of the main shading function for the shader.
void ShaderHelper< ShaderParameters >::setupMayaBumpMapping | ( | ) | const [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 ShaderHelper< 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 ShaderHelper< 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 ShaderHelper< 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.
miColor ShaderHelper< 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 ShaderHelper< 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 ShaderHelper< 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. |
miColor ShaderHelper< 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 ShaderHelper< 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 ShaderHelper< 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 ShaderHelper< 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 ShaderHelper< ShaderParameters >::getReflectedColor | ( | ) | const [inline] |
Return the reflected color for this shader.
Return the reflected color for this shader.
Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |