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_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:
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
public RED::RenderShaderVertexColor::RenderShaderVertexColor | ( | RED::MATERIAL_PASS | iPass, |
RED::MESH_CHANNEL | iVertexColorChannel, | ||
RED::Object * | iResMgr, | ||
RED_RC & | oErrorCode | ||
) |
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. |
public virtual RED::RenderShaderVertexColor::~RenderShaderVertexColor | ( | ) |
Destructor.
public static RED_RC RED::RenderShaderVertexColor::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::RenderShaderVertexColor::GetClassID | ( | ) |
Reimplements: RED::RenderShader::GetClassID.
public static RED_RC RED::RenderShaderVertexColor::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::RenderShaderVertexColor::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::RenderShaderVertexColor::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::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:
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:
Reimplements: RED::RenderShader::As.