class RED::RayGIRefractionColorShader

Built-in Global Illumination shader for refraction color calculations. More...

#include <REDRayGIRefractionColorShader.h>

Inherits: RenderShader.

Public functions:

RayGIRefractionColorShader ( const RED::Color & iOpacityColor, const RED::Object * iOpacityTexture, const RED::Matrix & iOpacityMatrix, RED::MESH_CHANNEL iOpacityUV, float iIOR, const RED::Object * iFresnel, RED::Object * iResMgr, RED_RC & oErrorCode )
~RayGIRefractionColorShader ( )
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_RCEvaluateFromInputParameters ( RED::RenderShader * ioShader, RED::Object * iResMgr )
static RED::CIDGetClassID ( )
static RED_RCLoadProgram ( RED::String & oString, const RED::ShaderProgramID & iID )

Detailed description:

Built-in Global Illumination shader for refraction color calculations.

This shader matches the standard refraction setup of a material. It uses an opacity color / texture and an optional Fresnel term to equilibrate the amount of energy that is reflected / transmitted. 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 one configuration:

See the REDRayGIRefractionColorShader.h file documentation for the list of all define statements used to name all parameters of this shader.

Functions documentation

public RED::RayGIRefractionColorShader::RayGIRefractionColorShader(const RED::Color &iOpacityColor,
const RED::Object *iOpacityTexture,
const RED::Matrix &iOpacityMatrix,
RED::MESH_CHANNELiOpacityUV,
floatiIOR,
const RED::Object *iFresnel,
RED::Object *iResMgr,
RED_RC &oErrorCode
)

RayGIRefractionColorShader construction method.

Parameters:

iOpacityColor:Opacity color.
iOpacityTexture:Opacity texture. Overrides the color when set.
iOpacityMatrix:Texture matrix applied to iOpacityTexture.
iOpacityUV:Mesh UV channel to use to sample iOpacityTexture.
iIOR:Index of refraction (IOR) of the material.
iFresnel:Must be NULL or a valid composite image. The '.xyz' value of the image returns the opacity to consider as the transmission color. RED::IImageComposite::Fresnel is a possible valid composite image for this shader.
iResMgr:The cluster's resource manager.
oErrorCode:Indicates a construction failure when not returned set to RED_OK.

RayGIRefractionColorShader destruction method.

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_OK if the operation has succeeded,
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.

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_OK if the shader could be loaded,
RED_ALLOC_FAILURE if an allocation has failed,
RED_FAIL otherwise.
public virtual void * RED::RayGIRefractionColorShader::As(const RED::CID &iCID)

Converts the object to an instance of the given type.

Parameters:

iCID:Requested class.

Returns:

An object pointer of the given class on success, NULL otherwise.

Reimplements: RED::RenderShader::As.

public virtual const void * RED::RayGIRefractionColorShader::As(const RED::CID &iCID) const

Converts the object to an instance of the given type.

Parameters:

iCID:Requested class.

Returns:

An object pointer of the given class on success, NULL otherwise.

Reimplements: RED::RenderShader::As.

template< class T_As > public const T_As * RED::RayGIRefractionColorShader::As() const

Template version of the as const method.

Simply set T to be the class you want to retrieve an interface to.

Returns:

A pointer to a const instance of class T on success, NULL otherwise.

Reimplements: RED::RenderShader::As.

template< class T_As > public T_As * RED::RayGIRefractionColorShader::As()

Template version of the as method.

Simply set T to be the class you want to retrieve an interface to.

Returns:

A pointer to an instance of class T on success, NULL otherwise.

Reimplements: RED::RenderShader::As.