DefaultCustomComponent< ParameterType, ResultType, ShaderHelper > Class Template Reference
[Custom Passes]

#include <adskComponent.h>

List of all members.


Detailed Description

template<typename ParameterType, typename ResultType, typename ShaderHelper>
class DefaultCustomComponent< ParameterType, ResultType, ShaderHelper >

Custom component.

This component is for computing custom results outside the normal set of results for surface shaders. It is called at multiple points in the light loop to allow for one or many custom results to be determined.

Template Parameters:
ParameterType The structure used in the shader declaration to represent the shader parameters.
ResultType The result structure for the shader.
ShaderHelper The class used in the shader declaration to represent the shader helper. See ShaderHelper for details on the required methods.

Public Member Functions

 DefaultCustomComponent (miState *pState, ParameterType *pParameters)
 Component constructor.
 ~DefaultCustomComponent ()
 Component destructor.
miBoolean shortCircuitShading (miState *pState, ParameterType *pParameters, ResultType *pResult, miBoolean *pShaderResult)
 Called at beginning of shading call, can stop shading.
void operator() (miState *pState, ParameterType *pParameters, ShaderHelper &pHelper, const miColor &pMaterialColor, const miVector &pLightDirection, miScalar pDotNL)
 Function object operator. Called for each sample on each light.
void adjustForSamples (ShaderHelper &pHelper, int pNumberOfSamples)
 Adjust results for number of samples from a light.
void adjustBeautyResult (miState *pState, ParameterType *pParameters, ShaderHelper &pHelper, miColor &pBeautyColor)
 Modify the color to add to custom beauty passes.
void adjustFinalResult (miState *pState, ParameterType *pParameters, ResultType *pResult, ShaderHelper &pHelper)
 Set custom results in result structure after light loop.

Constructor & Destructor Documentation

template<typename ParameterType, typename ResultType, typename ShaderHelper>
DefaultCustomComponent< ParameterType, ResultType, ShaderHelper >::DefaultCustomComponent ( miState *  pState,
ParameterType *  pParameters 
) [inline]

Component constructor.

Parameters:
[in,out] pState The mental ray rendering state.
[in] pParameters The shader parameters.


Member Function Documentation

template<typename ParameterType, typename ResultType, typename ShaderHelper>
miBoolean DefaultCustomComponent< ParameterType, ResultType, ShaderHelper >::shortCircuitShading ( miState *  pState,
ParameterType *  pParameters,
ResultType *  pResult,
miBoolean *  pShaderResult 
) [inline]

Called at beginning of shading call, can stop shading.

This is called before anything else in the main shading function, returning true will cause shading to stop and return the result found in shaderResult. Use to prevent full light loop and shading in special cases. Can fill in results in result.

Parameters:
[in,out] pState The mental ray rendering state.
[in] pParameters The shader parameters.
[in,out] pResult The result structure for the shader
[out] pShaderResult What the shader should return if short circuiting

template<typename ParameterType, typename ResultType, typename ShaderHelper>
void DefaultCustomComponent< ParameterType, ResultType, ShaderHelper >::operator() ( miState *  pState,
ParameterType *  pParameters,
ShaderHelper pHelper,
const miColor &  pMaterialColor,
const miVector &  pLightDirection,
miScalar  pDotNL 
) [inline]

Function object operator. Called for each sample on each light.

Parameters:
[in,out] pState The mental ray rendering state.
[in,out] pParameters The shader parameters.
[in,out] pHelper The shader helper for this shader.
[in] pMaterialColor The raw material color of the surface, evaluated at the current intersection
[in] pLightDirection The direction of incoming light
[in] pDotNL The dot product of the direction from the current intersection point in the state to the light and the normal in the state

template<typename ParameterType, typename ResultType, typename ShaderHelper>
void DefaultCustomComponent< ParameterType, ResultType, ShaderHelper >::adjustForSamples ( ShaderHelper pHelper,
int  pNumberOfSamples 
) [inline]

Adjust results for number of samples from a light.

Called after all samples have been accumulated to allow the results to be adjusted based on the number of samples for the current light.

Parameters:
[in,out] pHelper The shader helper for this shader.
[in] pNumberOfSamples The number of samples taken for the light

template<typename ParameterType, typename ResultType, typename ShaderHelper>
void DefaultCustomComponent< ParameterType, ResultType, ShaderHelper >::adjustBeautyResult ( miState *  pState,
ParameterType *  pParameters,
ShaderHelper pHelper,
miColor &  pBeautyColor 
) [inline]

Modify the color to add to custom beauty passes.

Parameters:
[in,out] pState The mental ray rendering state
[in] pParameters The shader parameters
[in,out] pHelper The shader helper for this shader.
[in,out] pBeautyColor The standard beauty result to modify

template<typename ParameterType, typename ResultType, typename ShaderHelper>
void DefaultCustomComponent< ParameterType, ResultType, ShaderHelper >::adjustFinalResult ( miState *  pState,
ParameterType *  pParameters,
ResultType *  pResult,
ShaderHelper pHelper 
) [inline]

Set custom results in result structure after light loop.

Parameters:
[in,out] pState The mental ray rendering state
[in] pParameters The shader parameters
[in,out] pResult The result structure for the shader
[in,out] pHelper The shader helper for this shader.


Autodesk® Maya® 2012 © 2010 Autodesk, Inc. All rights reserved. Generated with doxygen 1.5.6