class RED::RenderShaderVertexColor

Per-vertex interpolated color shader. More...

#include <REDRenderShaderVertexColor.h>

Inherits: RenderShader.

Public functions:

RenderShaderVertexColor ( RED::MATERIAL_PASS iPass, RED::MESH_CHANNEL iVertexColorChannel, RED::Object * iResMgr, RED_RC & oErrorCode )
virtual ~RenderShaderVertexColor ( )
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:

Per-vertex interpolated color shader.

This shader can be used to produce per-vertex modulated illumination models. The shader uses the specified RED::MESH_CHANNEL input channel as colors defined for each vertex of the geometry. This color is used to produce a per-pixel color after interpolation over triangles of the geometry.

The RenderShaderVertexColor is usable in any pre-lighting of post-lighting pass of the material.

This shader creates one RED::HW_GENERIC platform configuration in direct lighting and two platform configurations RED::HW_NVIDIA_GENERIC and RED::HW_ATI_GENERIC in indirect lighting.

This shader only declares default ray-tracer parameters bindings in indirect lighting, using the RED_SHAD_TARGET_LIGHT_NO_LIGHT target.

Functions documentation

Constructor.

Parameters:

iPass:Targets RED::MTL_PRELIT, RED::MTL_POSTLIT for direct lighting passes or RED::MTL_INDIRECT_PRELIT or RED::MTL_INDIRECT_POSTLIT for indirect lighting passes.
iVertexColorChannel:Index of the geometry channel to use to retrieve vertex color information.
iResMgr:The cluster's resource manager.
oErrorCode:Indicates a construction failure when not returned set to RED_OK.

Destructor.

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::RenderShaderVertexColor::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::RenderShaderVertexColor::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::RenderShaderVertexColor::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::RenderShaderVertexColor::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.