class RED::RayGIDiffuseShader
Built-in Global Illumination shader for diffuse color and normal calculations. More...
#include <REDRayGIDiffuseShader.h>
Inherits: RenderShader.
Public functions:
RayGIDiffuseShader ( const RED::Color & iDiffuseColor, const RED::Object * iDiffuseTexture, const RED::Matrix & iDiffuseMatrix, RED::MESH_CHANNEL iDiffuseUV, const RED::Color & iOpacityColor, const RED::Object * iOpacityTexture, const RED::Matrix & iOpacityMatrix, RED::MESH_CHANNEL iOpacityUV, const RED::Object * iNormalMap, const RED::Matrix & iNormalMatrix, RED::MESH_CHANNEL iNormalUV, RED::MESH_CHANNEL iTangentChannel, RED::Object * iResMgr, RED_RC & oErrorCode ) | |
~RayGIDiffuseShader ( ) | |
virtual void * | As ( const RED::CID & iCID ) |
virtual const void * | As ( const RED::CID & iCID ) const |
template< class T_As > const T_As * | As ( ) const |
template< class T_As > T_As * | As ( ) |
Public static functions:
static RED_RC | EvaluateFromInputParameters ( RED::RenderShader * ioShader, RED::Object * iResMgr ) |
static RED::CID | GetClassID ( ) |
static RED_RC | LoadProgram ( RED::String & oString, const RED::ShaderProgramID & iID ) |
Detailed description:
Built-in Global Illumination shader for diffuse color and normal calculations.
This shader works with any built-in lighting shader (RED::RenderShaderPhong, RED::RenderShaderLambert, ...). It uses the same set of parameters used to define diffusion and interpolated normal parameters in the lighting shader. Values produced by this shader are used for global illumination calculations.
This shader is intended for use in the RED::MTL_RAYTRACE rendering pass.
This shader has 4 configurations:
See the REDRayGIDiffuseShader.h file documentation for the list of all define statements used to name all parameters of this shader.
Functions documentation
public RED::RayGIDiffuseShader::RayGIDiffuseShader | ( | const RED::Color & | iDiffuseColor, |
const RED::Object * | iDiffuseTexture, | ||
const RED::Matrix & | iDiffuseMatrix, | ||
RED::MESH_CHANNEL | iDiffuseUV, | ||
const RED::Color & | iOpacityColor, | ||
const RED::Object * | iOpacityTexture, | ||
const RED::Matrix & | iOpacityMatrix, | ||
RED::MESH_CHANNEL | iOpacityUV, | ||
const RED::Object * | iNormalMap, | ||
const RED::Matrix & | iNormalMatrix, | ||
RED::MESH_CHANNEL | iNormalUV, | ||
RED::MESH_CHANNEL | iTangentChannel, | ||
RED::Object * | iResMgr, | ||
RED_RC & | oErrorCode | ||
) |
RayGIDiffuseShader construction method.
Parameters:
iDiffuseColor: | Diffuse object color. |
iDiffuseTexture: | Diffuse object texture. Overrides the diffuse color when set. |
iDiffuseMatrix: | Diffuse object texture transformation matrix. |
iDiffuseUV: | Diffuse texture UV mesh channel. |
iOpacityColor: | Opacity object color. |
iOpacityTexture: | Opacity object texture. Overrides the opacity color when set. |
iOpacityMatrix: | Opacity object texture transformation matrix. |
iOpacityUV: | Opacity texture UV mesh channel. |
iNormalMap: | Surface normal perturbation map. NULL for no normal map. |
iNormalMatrix: | Normal map texture transformation matrix. |
iNormalUV: | Normal map texture UV mesh channel. |
iTangentChannel: | Mesh channel containing the vertex tangents. |
iResMgr: | The cluster's resource manager. |
oErrorCode: | Indicates a construction failure when not returned set to RED_OK. |
RayGIDiffuseShader destruction method.
public static RED_RC RED::RayGIDiffuseShader::EvaluateFromInputParameters | ( | RED::RenderShader * | ioShader, |
RED::Object * | iResMgr | ||
) |
Evaluate a shader from its input parameters.
Parameters:
ioShader: | Shader to redefine using its own input parameters. |
iResMgr: | The cluster's resource manager. |
Returns:
RED_BAD_PARAM if iShader was not valid,
RED_BAD_PARAM if an invalid parameter was found during the evaluation,
RED_ALLOC_FAILURE if a memory allocation has failed,
Other RED_RC related to shader creation can be returned.
public static RED::CID RED::RayGIDiffuseShader::GetClassID | ( | ) |
Reimplements: RED::RenderShader::GetClassID.
public static RED_RC RED::RayGIDiffuseShader::LoadProgram | ( | RED::String & | oString, |
const RED::ShaderProgramID & | iID | ||
) |
Loads a shader program.
Generates a shader program that corresponds to the specified iID.
Parameters:
oString: | The created program string. |
iID: | The shader program unique ID. |
Returns:
RED_ALLOC_FAILURE if an allocation has failed,
RED_FAIL otherwise.
public virtual void * RED::RayGIDiffuseShader::As | ( | const RED::CID & | iCID | ) |
Converts the object to an instance of the given type.
Parameters:
iCID: | Requested class. |
Returns:
Reimplements: RED::RenderShader::As.
public virtual const void * RED::RayGIDiffuseShader::As | ( | const RED::CID & | iCID | ) const |
Converts the object to an instance of the given type.
Parameters:
iCID: | Requested class. |
Returns:
Reimplements: RED::RenderShader::As.
template< class T_As > public const T_As * RED::RayGIDiffuseShader::As | ( | ) const |
Template version of the as const method.
Simply set T to be the class you want to retrieve an interface to.
Returns:
Reimplements: RED::RenderShader::As.
template< class T_As > public T_As * RED::RayGIDiffuseShader::As | ( | ) |
Template version of the as method.
Simply set T to be the class you want to retrieve an interface to.
Returns:
Reimplements: RED::RenderShader::As.