class RED::RenderShaderEdges

Edge selection and rendering shader. More...

#include <REDRenderShaderEdges.h>

Inherits: RenderShader.

Public functions:

RenderShaderEdges ( RED::MATERIAL_PASS iRenderingPass, RED::MESH_CHANNEL iVertexChannel, RED::MESH_CHANNEL iNormal1Channel, RED::MESH_CHANNEL iNormal2Channel, const RED::Color & iColor, bool iDrawBorder, bool iDrawContour, float iCreaseAngle, RED::Object * iResMgr, RED_RC & oErrorCode )
virtual ~RenderShaderEdges ( )
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:

Edge selection and rendering shader.

This shader is used on objects that implement the RED::ILineShape interface. It uses edges attributes information to filter edges that must be rendered in a geometry, among:

Edges are rendered using a constant color (including alpha output).

The shader requires the following data channel on the input lines:

The result of RED::IMeshShape::BuildContourEdges generates data that is well suited for using with this shader.

This shader creates the following platform configurations:

All parameters declared by this shader are using the RED_SHAD_TARGET_LIGHT_NO_LIGHT shader target (commonly used in its shortcut form RED_L0), except for the declared software kill shader statements that are using the RED_SHAD_TARGET_SOFT_KILL target.

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

Functions documentation

public RED::RenderShaderEdges::RenderShaderEdges(RED::MATERIAL_PASSiRenderingPass,
RED::MESH_CHANNELiVertexChannel,
RED::MESH_CHANNELiNormal1Channel,
RED::MESH_CHANNELiNormal2Channel,
const RED::Color &iColor,
booliDrawBorder,
booliDrawContour,
floatiCreaseAngle,
RED::Object *iResMgr,
RED_RC &oErrorCode
)

Constructor.

Parameters:

iRenderingPass:The target rendering pass in RED::MTL_PRELIT, or RED::MTL_POSTLIT.
iVertexChannel:Source channel with vertex information.
iNormal1Channel:First adjacent triangle normal channel.
iNormal2Channel:Second adjacent triangle normal channel.
iColor:Output edge color.
iDrawBorder:Render border edges?
iDrawContour:Render contour edges?
iCreaseAngle:Crease angle below which inner edges will be filtered (in radians). Set to RED_PI to discard all inner edges.
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::RenderShaderEdges::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::RenderShaderEdges::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::RenderShaderEdges::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::RenderShaderEdges::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.