Material< MaterialParameters, ShaderHelper, VERSION >
Class Template Reference
#include
<adskShader.h>
List of all
members.
Detailed Description
template<typename MaterialParameters, typename ShaderHelper,
int VERSION = 1>
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] |
Main shading function.
This is the function which is called for shader samples.
- Parameters:
-
[out] |
pResult |
A pointer to the mental ray color result. |
[in,out] |
pState |
A pointer to the mental ray state structure. |
[in] |
pParameters |
A pointer to the shader parameters. |
- Returns:
- True if the shader call was successful, false otherwise.
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. |