Material< MaterialParameters, ShaderHelper, VERSION > Class Template Reference
#include <adskShader.h>
List of all members.
Detailed Description
template<typename MaterialParameters, typename ShaderHelper, int VERSION = 2>
class Material< MaterialParameters, ShaderHelper, VERSION >
Material shader class.
This class holds all data and behaviors which are specific to mental ray material shaders. It is an extension of the base class
Shader.
- Template Parameters:
-
| MaterialParameters | The material parameter structure. |
| ShaderHelper | The shader helper to use with this shader. |
| VERSION | The version of this shader. Should match the version of the shader declared in the .mi file. |
Constructor & Destructor Documentation
template<typename MaterialParameters, typename ShaderHelper, int VERSION>
Material shader constructor.
This will be called once per shader instance, and is where data for each shader instance should be initialized.
- Parameters:
-
| [in,out] | pState | A pointer to the mental ray state structure. |
| [in] | pParameters | A pointer to the shader parameters. |
template<typename MaterialParameters, typename ShaderHelper, int VERSION>
Material shader destructor.
The member variables
mDestructorState and
mDestructorParameters will be set correctly when the destructor is called.
Member Function Documentation
template<typename MaterialParameters, typename ShaderHelper, int VERSION>
| miBoolean Material< MaterialParameters, ShaderHelper, VERSION >::operator() |
( |
miColor * |
pResult, |
|
|
miState * |
pState, |
|
|
MaterialParameters * |
pParameters | |
|
) |
| | [inline] |
template<typename MaterialParameters, typename ShaderHelper, int VERSION>
template<typename T>
| void Material< MaterialParameters, ShaderHelper, VERSION >::writeToFrameBuffers |
( |
miState * |
pState, |
|
|
FrameBufferInfo * |
pFrameBufferInfo, |
|
|
PassTypeInfo * |
pPassTypeInfo, |
|
|
const T & |
pValue, |
|
|
PassTypeID |
pPassType, |
|
|
const bool & |
pUseIrradiance, |
|
|
const miColor *const & |
pIrradianceNoShadow = 0 | |
|
) |
| | [inline] |
Write to frame buffers of a given type.
- Parameters:
-
| [in,out] | pState | The shading state |
| [in,out] | pFrameBufferInfo | The array of frame buffer information structs |
| [in] | pPassTypeInfo | The array of pass type information structs |
| [in] | pValue | The value to be written to the frame buffer |
| [in] | pPassType | The pass type ID that identifies the frame buffer to be written to |
| [in] | pUseIrradiance | Set to true if the value should be modulated by irradiance. This option should only be used inside a light loop. |
| [in] | pIrradianceNoShadow | Sample irradiance without shadows, used to compute differential shadow passes. When non-null, the difference between pIrradianceNoShadow and the sample irradiance is used as a lighting factor, instead of the sample irradiance. |