class RED::StateShader

Rendering pipeline configuration shader class. More...

#include <REDStateShader.h>

Inherits: Shader.

Public functions:

StateShader ( )
virtual ~StateShader ( )
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 ( )
virtual RED::Shader *Clone ( ) const
RED_RCGetAlphaThreshold ( float & oAlpha, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetBlendingMode ( BLENDING_MODE & oBlend, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetBlendingMode ( BLENDING_MODE & oBlend, BLENDING_FUNCTION & oFunction1, BLENDING_EQUATION & oEquation, BLENDING_FUNCTION & oFunction2, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetBlendingMode ( BLENDING_FUNCTION & oFunction1, BLENDING_EQUATION & oEquation, BLENDING_FUNCTION & oFunction2, int iNumBuffer, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetColorMask ( bool & oWriteR, bool & oWriteG, bool & oWriteB, bool & oWriteA, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetDepthFunction ( FUNCTION & oFunc, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetDepthMask ( DEPTH_MODE & oMask, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetDepthTest ( DEPTH_MODE & oDepth, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetDisplacement ( float & oDispHeight, RED::Object *& oDispTexture, RED::Matrix & oDispMatrix, RED::MESH_CHANNEL & oDispUV, float & oDispOffset, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetDoubleSided ( bool & oDoubleSided, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetFaceCulling ( CULLING_MODE & oCullMode, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetLineSmoothing ( bool & oOnOff, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetLineStipple ( bool & oOnOff, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetLineStipplePattern ( int & oFactor, short & oPattern, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetLineWidth ( float & oWidth, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetMatte ( bool & oMatte, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
virtual RED_RCGetOperationStream ( const RED::Object * iCaller, RED::Vector< int > & ioStream, RED::HARDWARE_PLATFORM iPlatformID ) const
RED_RCGetPlatformList ( RED::Vector< RED::HARDWARE_PLATFORM > & oPlatformList ) const
RED_RCGetPlatformsCount ( int & oCount ) const
RED_RCGetPointSize ( float & oPointSize, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetPointSmoothing ( bool & oOnOff, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetPolygonOffset ( bool & oOnOff, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetPolygonOffsetValue ( float & oFactor, float & oUnits, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetReflectiveCaustics ( bool & oReflectiveCaustics, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetRefractiveCaustics ( bool & oRefractiveCaustics, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetStencilFunction ( FUNCTION & oFunc, int & oRef, int & oMask, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetStencilMask ( int & oMask, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetStencilOperation ( STENCIL_OPERATION & oFailOp, STENCIL_OPERATION & oZFailOp, STENCIL_OPERATION & oZPassOp, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetStencilTest ( STENCIL_MODE & oStencil, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetTransparencyColor ( RED::Color & oTransparColor, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetTransparencyImage ( RED::Object ** oImage, RED::MESH_CHANNEL & oUVChannel, RED::Matrix & oMatrix, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
RED_RCGetTransparencyMode ( TRANSPARENCY_MODE & oTransparency, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC ) const
IMPLEMENT_CHUNKINTERPRETER ( )
virtual RED_RCSave ( RED::IStream * iStream, StreamingPolicy & iPolicy, int iState = -1 ) const
RED_RCSetAlphaThreshold ( float iAlphaThreshold, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetBlendingConstant ( const RED::Color & iConstant, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetBlendingMode ( BLENDING_MODE iBlendingMode, BLENDING_FUNCTION iFunction1, BLENDING_EQUATION iOperation, BLENDING_FUNCTION iFunction2, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetBlendingMode ( int iNumBuffer, BLENDING_FUNCTION iFunction1, BLENDING_EQUATION iOperation, BLENDING_FUNCTION iFunction2, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetBlendingMode ( BLENDING_MODE iBlendingMode, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetColorMask ( bool iWriteR, bool iWriteG, bool iWriteB, bool iWriteA, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetDepthFunction ( FUNCTION iFunc, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetDepthMask ( DEPTH_MODE iMask, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetDepthTest ( DEPTH_MODE iTest, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetDisplacement ( float iDispHeight, const RED::Object * iDispTexture, const RED::Matrix & iDispMatrix, RED::MESH_CHANNEL iDispUV, float iDispOffset, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetDoubleSided ( bool iDoubleSided, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetFaceCulling ( CULLING_MODE iCullingMode, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetLineSmoothing ( bool iOnOff, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetLineStipple ( bool iOnOff, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetLineStipplePattern ( int iFactor, short iPattern, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetLineWidth ( float iWidth, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetMaskedTransparency ( const RED::Object * iAlphaImage, RED::MESH_CHANNEL iAlphaChannel, const RED::Matrix & iAlphaMatrix, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetMatte ( bool iMatte, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetNoTransparency ( RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetPointSize ( float iSize, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetPointSmoothing ( bool iOnOff, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetPolygonOffset ( bool iOnOff, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetPolygonOffsetValue ( float iFactor, float iUnits, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetReflectiveCaustics ( bool iReflectiveCaustics, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetRefractiveCaustics ( bool iRefractiveCaustics, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetSortedAndMaskedTransparency ( const RED::Object * iOpacityTexture, RED::MESH_CHANNEL iOpacityUV, const RED::Matrix & iOpacityMatrix, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetSortedTransparency ( const RED::Color & iOpacityColor, const RED::Object * iOpacityTexture, RED::MESH_CHANNEL iOpacityUV, const RED::Matrix & iOpacityMatrix, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetSortedTransparency ( const RED::Color & iOpacityColor, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetStencilFunction ( FUNCTION iFunc, int iRef, int iMask, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetStencilMask ( int iMask, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetStencilOperation ( STENCIL_OPERATION iFailOp, STENCIL_OPERATION iZFailOp, STENCIL_OPERATION iZPassOp, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSetStencilTest ( STENCIL_MODE iTest, RED::HARDWARE_PLATFORM iPlatformID = RED::HW_GENERIC )
RED_RCSolve ( RED::IReferenceManager * iReferenceManager, const RED::State & iState )
virtual RED_RCUpdateFrom ( const RED::Object & iShader, const RED::State & iState, int iSrcStateNumber )

Public static functions:

static RED::CIDGetClassID ( )

Public enumerations:

enumBLENDING_EQUATION { ADD =  0, SUBTRACT =  1, REVERSE_SUBTRACT =  2, MIN =  3, MAX =  4, EQ_ENUM_SIZE =  5 }
enumBLENDING_FUNCTION { ZERO =  0, ONE =  1, SRC_COLOR =  2, ONE_MINUS_SRC_COLOR =  3, DST_COLOR =  4, ONE_MINUS_DST_COLOR =  5, SRC_ALPHA =  6, ONE_MINUS_SRC_ALPHA =  7, DST_ALPHA =  8, ONE_MINUS_DST_ALPHA =  9, SRC_ALPHA_SATURATE =  10, CONSTANT_COLOR =  11, ONE_MINUS_CONSTANT_COLOR =  12, CONSTANT_ALPHA =  13, ONE_MINUS_CONSTANT_ALPHA =  14, FUNC_ENUM_SIZE =  15 }
enumBLENDING_MODE { SKIP =  0, NO_BLENDING =  1, ADDITIVE =  2, SUBTRACTIVE =  3, MULTIPLICATIVE =  4, CUSTOM =  5 }
enumCULLING_MODE { BACK =  0, FRONT =  1, NONE =  2 }
enumDEPTH_MODE { DEPTH_SKIP =  0, ON =  1, OFF =  2 }
enumFUNCTION { NEVER =  0, LESS =  1, LEQUAL =  2, GREATER =  3, GEQUAL =  4, EQUAL =  5, NOTEQUAL =  6, ALWAYS =  7 }
enumSTENCIL_MODE { STENCIL_ON =  0, STENCIL_OFF =  1 }
enumSTENCIL_OPERATION { STENCIL_OP_KEEP =  0, STENCIL_OP_ZERO =  1, STENCIL_OP_REPLACE =  2, STENCIL_OP_INCR =  3, STENCIL_OP_DECR =  4, STENCIL_OP_INVERT =  5 }
enumTRANSPARENCY_MODE { NO_TRANSPARENCY =  0, MASKED_TRANSPARENCY =  1, SORTED_TRANSPARENCY =  2, SORTED_AND_MASKED_TRANSPARENCY =  3 }

Protected functions:

const RED::StateShaderPlatformData *FindPlatformData ( RED::HARDWARE_PLATFORM iPlatformID ) const
RED::StateShaderPlatformData &GetPlatformData ( RED_RC & oRC, RED::HARDWARE_PLATFORM iPlatformID )
RED::StateShaderPlatformData *PlatformLookup ( RED::HARDWARE_PLATFORM iPlatformID, bool iExactMatch ) const

Protected variables:

RED::Vector< RED::StateShaderPlatformData >_platform

Detailed description:

Rendering pipeline configuration shader class.

The RED::StateShader is used to configure the rendering pipeline for all shaders that are rendered after it in a list of shaders in a material. Hardware and software state parameters are managed using this shader. State parameters include all the parameters typically involved in the setup of a rendering pass, such as depth equation, blending mode, stencil, lines or point shapes, etc...

Transparency should be consistent across all state shaders within a material. Ray-traced transparency information will be based on an analysis of the state shaders of the material.

Default state shader parameters are set to:

The RED::StateShader supports multiple hardware platforms, as the RED::RenderShader do. On setting up a given platform for the first time, the state shader clones any more generic platform that was setup before. For example if the shader uses a give polygon offset setup for RED::HW_GENERIC platform, on setting up a parameter for the RED::HW_NVIDIA_G400 platform, all values from the RED::HW_GENERIC platform will be copied. However, once the two platform exist, there's no more copy of any setting: modifying the RED::HW_GENERIC platform will not change the RED::HW_NVIDIA_G400 platform parameters.

Functions documentation

Construction method.

The StateShader is using a RED::HARDWARE_PLATFORM identifier for all data setup & access, in all ways similarly to the RED::RenderShader, so that the same state shader instance can behave differently on different hardware.

A state shader uses the default RED::Object ID set at its creation time.

Destruction method.

public virtual void * RED::StateShader::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::Shader::As.

public virtual const void * RED::StateShader::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::Shader::As.

template< class T_As > public const T_As * RED::StateShader::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::Shader::As.

template< class T_As > public T_As * RED::StateShader::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::Shader::As.

public virtual RED::Shader * RED::StateShader::Clone() const

Object duplication.

Returns:

An allocated copy of this.

Implements: RED::Shader::Clone.

Gets the alpha masking threshold.

Parameters:

oAlpha:The alpha threshold value for all shaders after this one.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Returns the state shader blending mode.

Parameters:

oBlend:The blending mode for the shader.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Returns the detailed state shader blending mode.

Parameters:

oBlend:The blending mode for the shader.
oFunction1:Function applied to the incoming fragment color.
oEquation:Operation combining the two colors.
oFunction2:Function applied to the buffer fragment color.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Returns the detailed state shader blending mode for a specified iNumBuffer.

Parameters:

oFunction1:Function applied to the incoming fragment color.
oEquation:Operation combining the two colors.
oFunction2:Function applied to the buffer fragment color.
iNumBuffer:The number of the buffer being targeted in the VRL.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.
public RED_RC RED::StateShader::GetColorMask(bool &oWriteR,
bool &oWriteG,
bool &oWriteB,
bool &oWriteA,
RED::HARDWARE_PLATFORMiPlatformID = RED::HW_GENERIC
)const

Gets the color masking mode.

Parameters:

oWriteR:Authorized to write red color component?
oWriteG:Authorized to write green color component?
oWriteB:Authorized to write blue color component?
oWriteA:Authorized to write alpha color component?
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Returns the depth function.

Parameters:

oFunc:The depth function for the shader.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Returns the depth masking mode.

Parameters:

oMask:The depth masking mode for the shader.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Returns the depth testing mode.

Parameters:

oDepth:The depth testing mode for the shader.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.
public RED_RC RED::StateShader::GetDisplacement(float &oDispHeight,
RED::Object *&oDispTexture,
RED::Matrix &oDispMatrix,
RED::MESH_CHANNEL &oDispUV,
float &oDispOffset,
RED::HARDWARE_PLATFORMiPlatformID = RED::HW_GENERIC
)const

Retrieves the displacement mapping parameters.

Parameters:

oDispHeight:Maximal displacement height in model units.
oDispMatrix:Displacement texture matrix.
oDispTexture:Displacement texture.
oDispUV:Displacement UV channel.
oDispOffset:Displacement offset translation.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Should the rendering be double sided?

Parameters:

oDoubleSided:true if we are double sided.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Gets the face culling mode.

Parameters:

oCullMode:Face culling mode.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Gets the line smoothing activation status.

Parameters:

oOnOff:Is line smoothing enabled ?
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Gets line stipple activation status.

Parameters:

oOnOff:Is line stipple enabled ?
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Gets the line stipple parameters.

Parameters:

oFactor:Line stipple factor. This is the scaling applied to the line stipple pattern.
oPattern:Line stipple pattern. This is a mask of 16 bits that define the line pattern used to draw lines.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Gets the pixel width of rendered lines.

Parameters:

oWidth:Pixel width of lines.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Gets the matte mode (see SetMatte for details).

Parameters:

oMatte:matte mode enabled?
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.
public virtual RED_RC RED::StateShader::GetOperationStream(const RED::Object *iCaller,
RED::Vector< int > &ioStream,
RED::HARDWARE_PLATFORMiPlatformID
)const

Internal access to the operation stream of a shader.

Internal RED usage method. Writes down the shader stream.

Parameters:

iCaller:Pointer to the method caller.
ioStream:Stream to write to.
iPlatformID:Target hardware platform identifier.

Returns:

RED_OK when the shader could have its operation stream written down,
RED_ALLOC_FAILURE if an internal allocation did fail,
RED_FAIL otherwise.

Reimplements: RED::Shader::GetOperationStream.

Gets the list of hardware platforms used by the shader.

This method fills a RED::Vector with the list of hardware platforms that are used by the shader.

Parameters:

oPlatformList:The list of hardware platforms.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Gets the number of platforms used by this shader.

This method returns the number of hardware platforms that have been configured for this shader.

Parameters:

oCount:Number of hardware platforms used by the shader.

Returns:

RED_OK when the method has succeeded,
RED_FAIL otherwise.

Gets the point size.

Parameters:

oPointSize:Return the point size diameter.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Gets the point smoothing activation status.

Parameters:

oOnOff:Is point smoothing enabled ?
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Gets the polygon offset activation status.

Parameters:

oOnOff:Is polygon offset enabled ?
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.
public RED_RC RED::StateShader::GetPolygonOffsetValue(float &oFactor,
float &oUnits,
RED::HARDWARE_PLATFORMiPlatformID = RED::HW_GENERIC
)const

Gets the polygon offset parameters.

Parameters:

oFactor:Angular factor used in the polygon offset equation.
oUnits:Number of biasing units in the polygon offset equation.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.
public RED_RC RED::StateShader::GetReflectiveCaustics(bool &oReflectiveCaustics,
RED::HARDWARE_PLATFORMiPlatformID = RED::HW_GENERIC
)const

Returns the reflective caustics enabled status.

Parameters:

oReflectiveCaustics:Reflective caustics enabled status.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.
public RED_RC RED::StateShader::GetRefractiveCaustics(bool &oRefractiveCaustics,
RED::HARDWARE_PLATFORMiPlatformID = RED::HW_GENERIC
)const

Returns the refractive enabled caustics status.

Parameters:

oRefractiveCaustics:Are refractive caustics enabled?
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Returns the stencil function.

Parameters:

oFunc:The stencil function set in this shader.
oRef:Reference value for the stencil test.
oMask:Bitwise AND mask for stencil test.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Returns the stencil writemask.

Parameters:

oMask:The stencil writemask.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Returns the stencil operations.

Parameters:

oFailOp:Stencil operation that occurs when the stencil test fails.
oZFailOp:Stencil operation that occurs when the stencil test passes and the depth test fails.
oZPassOp:Stencil operation that occurs when the stencil test and the depth test passes.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Returns the stencil testing mode.

Parameters:

oStencil:The stencil testing mode for the shader.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Gets the color of the transparency.

Parameters:

oTransparColor:Transparency color.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Retrieves transparency texture parameters.

Parameters:

oImage:Address of the transparency / alpha texture if it exists.
oUVChannel:Mesh channel used to sample 'oImage'.
oMatrix:Texture matrix for 'oImage'.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.

Returns the kind of transparency we manage.

Parameters:

oTransparency:The transparency mode for all shaders after this one in its rendering pass.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter.
public virtual RED_RC RED::StateShader::Save(RED::IStream *iStream,
StreamingPolicy &iPolicy,
intiState = -1
)const

Internal class streaming.

Parameters:

iStream:The target stream.
iPolicy:The streaming policy.
iState:The written transaction number.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation has failed,
RED_FAIL otherwise.

Implements: RED::IChunkSaver::Save.

Defines the alpha masking threshold.

This value is used to define the alpha masking ratio for alpha masked transparency.

See Alpha masking for details.

Parameters:

iAlphaThreshold:New value [0.0f,1.0f].
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Sets the constant colors/alpha usable in the blending.

Sets the constant color that can be used in a blending equation, for functions using one of the following BLENDING_FUNCTIONs:

  • CONSTANT_COLOR,
  • ONE_MINUS_CONSTANT_COLOR,
  • CONSTANT_ALPHA,
  • ONE_MINUS_CONSTANT_ALPHA.

See Transparency and Blending for details on blending and transparency.

Parameters:

iConstant:Source and destination color constant.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Defines the color blending mode.

Sets the blending mode for all incoming geometry. All parameters of the blending equation are set by this call.

See Transparency and Blending for details on blending and transparency.

Parameters:

iBlendingMode:The blending mode to use.
iFunction1:Function applied to the incoming fragment color.
iOperation:Operation combining the two colors.
iFunction2:Function applied to the buffer fragment color.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Defines the color blending mode for a single drawing buffer of a multiple render target VRL.

Requires blending to be activated using RED::StateShader::SetBlendingMode and the rendering to occur in a multiple render target VRL, created using RED::IWindow::CreateMultiRenderTargetVRL.

A first call to RED::StateShader::SetBlendingMode will turn on blending for all drawing buffers available in the VRL. Then, per buffer blending operations can be configured using this call.

See Transparency and Blending for details on blending and transparency.

Note that your hardware must support the ARB_draw_buffers_blend OpenGL extension, otherwise, the operation is ignored.

Parameters:

iNumBuffer:The number of the buffer being targeted.
iFunction1:Function applied to the incoming fragment color.
iOperation:Operation combining the two colors.
iFunction2:Function applied to the buffer fragment color.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Defines the color blending mode.

Sets the blending mode for all incoming geometry. The RED::StateShader::SKIP blending mode indicates that the state shader will not interfere with the current blending parameters.

See Transparency and Blending for details on blending and transparency.

Parameters:

iBlendingMode:The blending mode to use.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.
public RED_RC RED::StateShader::SetColorMask(booliWriteR,
booliWriteG,
booliWriteB,
booliWriteA,
RED::HARDWARE_PLATFORMiPlatformID = RED::HW_GENERIC
)

Defines the color write mode.

Parameters:

iWriteR:Authorized to write red color component?
iWriteG:Authorized to write green color component?
iWriteB:Authorized to write blue color component?
iWriteA:Authorized to write alpha color component?
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation has failed.

Specifies the depth function to use.

Depth testing must be enabled for this function to be effectively set.

Parameters:

iFunc:The new depth test function.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Specifies the depth masking (write) mode.

SKIP lets the previous state shader or pass startup mode unmodified.

Parameters:

iMask:The new depth write mode.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Specifies the depth testing mode.

SKIP lets the previous state shader or pass startup mode unmodified.
Note that in standard OpenGL if the depth test is disabled, then there won't be any depth write that will occur, even if the depth mask is enabled.

Parameters:

iTest:The new depth test mode.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.
public RED_RC RED::StateShader::SetDisplacement(floatiDispHeight,
const RED::Object *iDispTexture,
const RED::Matrix &iDispMatrix,
RED::MESH_CHANNELiDispUV,
floatiDispOffset,
RED::HARDWARE_PLATFORMiPlatformID = RED::HW_GENERIC
)

Defines a displacement map for the rendering of the object.

Defines a displacement map for the object. A displacement map is used to define a surface elevation at each texel on the rendered geometry. Texel triangles are created in a transient manner during the rendering to increase the detail of rendered geometries.

The height of the displacement map is the .x coordinate read from the texture map. The displacement map must be a RED::TGT_TEX_2D texture. The RED::FMT_L8 is best to use for the texture storage.

Displacement mapping can be removed by calling SetDisplacement with NULL as displacement texture.

Displacement mapping can be enabled or disabled for the ray-tracer by setting the wished RED::OPTIONS_RAY_DISPLACEMENT value.

Displacement mapping is ignored in hardware rendering.

See Adding displacement mapping to a material for a displacement mapping example.

Parameters:

iDispHeight:Maximal height of the displacement in model units. This value must be positive. To have a displacement "below" the displaced surface, please use a negative 'iDispOffset' value and a positive 'iDispHeight'.
iDispTexture:Displacement texture. Must be a valid 2D image or NULL to disable displacement.
iDispMatrix:Displacement texture matrix.
iDispUV:UV channel to use to sample the displacement texture. Must be in the [ RED::MCL_TEX0, RED::MCL_TEX7 ] range.
iDispOffset:Displacement offset. This is a global translation of the displacement region. Setting a negative offset value for example equal to 'iDispHeight' generates a displacement surface that appears below the actual original surface level.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation has failed.

Renders the geometry once or twice.

Renders the geometry once if iDoubleSided is false, and renders the geometry twice if iDoubleSided is true. The polygon facing reference RED::RenderShaderParameter::REF_POLYGON_FACING can be used to identify which object side is currently being rendered.

Parameters:

iDoubleSided:Are we double sided ?
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Sets the face culling mode.

Sets the culling mode for all incoming geometries.

Parameters:

iCullingMode:Face culling mode.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Enables or disables line smoothing.

Uses OpenGL line smoothing capabilities, improving the quality of thick lines being rendered with a line stipple pattern.

Parameters:

iOnOff:Enable or disable line smoothing.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Enables or disables line stipple.

See Hidden lines removal: A real-time example for a practical example of line stipple.

Parameters:

iOnOff:Enable or disable line stipple.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Defines the line stipple parameters.

See Hidden lines removal: A real-time example for a practical example of line stipple.

Parameters:

iFactor:Line stipple factor. This is the scaling applied to the line stipple pattern. Input value is clamped to [1,256]. For example, using a factor of 3 repeats three times each bit equal to 1 defined in the pattern.
iPattern:Line stipple pattern. This is a mask of 16 bits that define the line pattern used to draw lines.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Specifies the pixel width of rendered lines.

Define the pixel width of rendered lines. Note that enabling engine anti-aliasing reduces the size of rendered lines because of the super sampling method used. When engine AA is enabled, it may be necessary to increase the specified line width.

The rendering of thick lines is supported by the GPU rendering but is not supported by the software ray-tracer. However, 1 pixel wide lines can be rendered by the software ray-tracer.

Parameters:

iWidth:Pixel width of lines.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Defines a mask based transparency.

See Alpha masking for details.

Parameters:

iAlphaImage:Specify the address of the alpha masking texture.
iAlphaChannel:Mesh channel source of the UV for the alpha mapping transparency texture sampling.
iAlphaMatrix:Texture matrix for iAlphaImage.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Defines the matte mode.

When a material has the matte mode set to true, it is considered as not being lit directly. Instead, it receives shadows cast by the other objects in the scene as well as their global illumination contribution.

Matte objects are useful when rendering synthetic objects into real-world photographs for example.

Parameters:

iMatte:Enable (true) or disable (false) matte mode.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation has failed.

Indicates that we are not transparent at all.

This is the default of a state shader.

Parameters:

iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Defines the point size.

Define the OpenGL point size. This is the diameter of the point size.

Parameters:

iSize:Diameter of rendered points.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Enables or disables point smoothing.

Uses OpenGL point smoothing capabilities, improving the quality of points being rendered with a point size greater than 1. If activated, points are rendered round instead of square.

Parameters:

iOnOff:Enable or disable point smoothing.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Enables or disables polygon offset.

Only triangle based data may be depth offseted using the polygon offset. Other primitives may not be offseted.
The polygon offset is useful to avoid geometry stitching artifacts and is widely used to prevent edges of a mesh to be z-fighting with the geometry they represent.

Parameters:

iOnOff:Enable or disable polygon offset.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Defines the polygon offset parameters.

The polygon offset is useful to avoid geometry stitching artifacts and is widely used to prevent edges of a mesh to be z-fighting with the geometry they represent.
Usually, 'iFactor' starts at 1.0 and is below 10.0; 'iUnits' starts at 1.0 and may be up to 100.0+ depending on the viewing conditions.

Parameters:

iFactor:Angular factor used in the polygon offset equation.
iUnits:Number of biasing units in the polygon offset equation.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Enables/disables reflective caustics.

True to enable the generation of reflective caustics.

Parameters:

iReflectiveCaustics:Are reflective caustics enabled?
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Enables/disables refractive caustics.

True to enable the generation of refractive caustics.

Parameters:

iRefractiveCaustics:Are refractive caustics enabled?
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Defines a depth sorted transparency with an alpha mask.

We use an opacity texture in this configuration. The texture's color is used as the opacity color, and the texture's alpha is used as alpha mask for the rendering.

Parameters:

iOpacityTexture:Opacity texture.
iOpacityUV:UV channel to use to sample the opacity texture.
iOpacityMatrix:Opacity texture matrix.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.
public RED_RC RED::StateShader::SetSortedTransparency(const RED::Color &iOpacityColor,
const RED::Object *iOpacityTexture,
RED::MESH_CHANNELiOpacityUV,
const RED::Matrix &iOpacityMatrix,
RED::HARDWARE_PLATFORMiPlatformID = RED::HW_GENERIC
)

Defines a per pixel depth sorted transparency.

We may use an opacity color or an opacity texture in this configuration. We are not alpha masked by the texture's alpha values.

See also Improving CAD graphics.

Parameters:

iOpacityColor:Opacity color.
iOpacityTexture:Opacity texture. Overrides iOpacityColor when set.
iOpacityUV:UV channel to use if we have a, opacity texture.
iOpacityMatrix:Opacity texture matrix.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation has failed.

Defines a per pixel depth sorted transparency.

We may use an opacity color here. This call is equivalent to setting a sorted transparency without texture using:

    RED::StateShader::SetSortedTransparency( iOpacityColor,
                                             NULL,
                                             RED::MCL_TEX0,
                                             RED::Matrix::IDENTITY,
                                             iPlatformID );

Parameters:

iOpacityColor:Opacity color.
iPlatformID:Platform identifier.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation has failed.

Defines the stencil function.

Defines the standard OpenGL stencil test: ( iRef & iMask ) iFunc ( stencil_buffer & iMask ) See No stencil buffer on auxiliary VRLs for details on using stencil buffer on various hardware.

Parameters:

iFunc:The new stencil test function.
iRef:Reference value for the stencil test.
iMask:Bitwise AND mask for stencil test.
iPlatformID:Platform identifier.

Returns:

RED_OK is the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation has failed.

Specifies the stencil writemask value.

See No stencil buffer on auxiliary VRLs for details on using stencil buffer on various hardware.

Parameters:

iMask:The new stencil mask value.
iPlatformID:Platform identifier.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation did fail.

Defines all stencil operations.

See No stencil buffer on auxiliary VRLs for details on using stencil buffer on various hardware.

Parameters:

iFailOp:Stencil operation that occurs when the stencil test fails.
iZFailOp:Stencil operation that occurs when the stencil test passes and the depth test fails.
iZPassOp:Stencil operation that occurs when the stencil test and the depth test passes.
iPlatformID:Platform identifier.

Returns:

RED_OK is the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation has failed.

Enables or disables stencil testing.

RED::StateShader::STENCIL_OFF is the default. See No stencil buffer on auxiliary VRLs for details on using stencil buffer on various hardware.

Parameters:

iTest:Specify the stencil test mode.
iPlatformID:Platform identifier.

Returns:

RED_OK is the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation has failed.
public RED_RC RED::StateShader::Solve(RED::IReferenceManager *iReferenceManager,
const RED::State &iState
)

Shader texture reference solving.

Parameters:

iReferenceManager:Reference repository.
iState:Current transaction parameter.
public virtual RED_RC RED::StateShader::UpdateFrom(const RED::Object &iShader,
const RED::State &iState,
intiSrcStateNumber
)

Internal update event method.

Parameters:

iShader:Source shader.
iState:Current transaction parameter.
iSrcStateNumber:Source state number.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter,
RED_ALLOC_FAILURE if an internal allocation has failed,
RED_FAIL otherwise.

Implements: RED::Shader::UpdateFrom.

Lookup for a given hardware platform data.

Parameters:

iPlatformID:Identifier of the platform to lookup.

Returns:

The platform container's address if it exists, NULL otherwise. A generic search is performed so that any generic platform compared to iPlatformID may be returned.

Lookup for a given hardware platform data.

This method will create a hardare platform data for iPlatformID if we have no match. The created platform data is initialized using any more generic platform found in the class.

Parameters:

oRC:RED_OK if the operation has succeeded,
RED_ALLOC_FAILURE if an internal allocation has failed.
iPlatformID:Identifier of the platform to lookup.

Returns:

The platform container's reference.

Looks for a given hardware platform data.

This method uses the hierarchical runtime platform lookup: it'll search for data that exactly match iPlatformID and then it'll try a generic platform research in case of failure, unless iExactMatch is set to true, in which case the search stops if the exact platform is not found.

Parameters:

iPlatformID:Identifier of the platform for the research.
iExactMatch:If true, the exact value of 'iPlatformId' is searched for, if false, the runtime platform hierarchy is used to look for a hardware compatible platform instead.

Returns:

The data for that hardware platform, NULL if we have no matching result.

Variables documentation

Per platform contents.

Enumerations documentation

Lists all possible blending operations mixing the incoming fragment color and the destination fragment color.

Enumerator:

ADD

color = src_color + dest_color.

SUBTRACT

color = src_color - dest_color.

REVERSE_SUBTRACT

color = dest_color - src_color.

MIN

color = min( src_color, dest_color ).

MAX

color = max( src_color, dest_color ).

EQ_ENUM_SIZE

Size of this enumeration.

Lists all functions that can apply to the source or destination colors in the blending equation. The blending formula is always 'func1(src_color) operation func2(dest_color)'.

Enumerator:

ZERO
ONE
SRC_COLOR
ONE_MINUS_SRC_COLOR
DST_COLOR
ONE_MINUS_DST_COLOR
SRC_ALPHA
ONE_MINUS_SRC_ALPHA
DST_ALPHA
ONE_MINUS_DST_ALPHA
SRC_ALPHA_SATURATE
CONSTANT_COLOR
ONE_MINUS_CONSTANT_COLOR
CONSTANT_ALPHA
ONE_MINUS_CONSTANT_ALPHA
FUNC_ENUM_SIZE

Select the blending mode for all incoming geometries.

Enumerator:

SKIP

Means that we do not affect the current blending statement.

NO_BLENDING
ADDITIVE

color = (src_color * src_alpha) + (dest_color * (1 - src_alpha)).

SUBTRACTIVE

color = (src_color * src_alpha) - (dest_color * (1 - src_alpha)).

MULTIPLICATIVE

color = src_color * dest_color.

CUSTOM

color = function1( src_color ) operand function2( dest_color ).

Select the side of a triangle that is to be visible during the rendering: BACK or FRONT. To render both faces of a polygon, use NONE.

Enumerator:

BACK

Culls back faces of the rendered geometry.

FRONT

Culls front faces of the rendered geometry.

NONE

Culls neither front nor back faces of the rendered geometry.

Enable or disable z testing or writing.

Enumerator:

DEPTH_SKIP

Let the current depth testing or writing mode unchanged (default).

ON

Enable depth testing using the specified depth comparison function or enable depth writing.

OFF

Disable depth testing or writing.

Enumeration of a depth or stencil test function.

Enumerator:

NEVER

Never pass the depth or stencil test for any fragment.

LESS

Pass the depth or stencil test if the incoming fragment's depth is less than the current buffer depth or stencil at the fragment's coordinates.

LEQUAL

Pass the depth or stencil test if the incoming fragment's depth is less than or equal to the current buffer depth or stencil at the fragment's coordinates.

GREATER

Pass the depth or stencil test if the incoming fragment's depth is greater than the current buffer depth or stencil at the fragment's coordinates.

GEQUAL

Pass the depth or stencil test if the incoming fragment's depth is greater than or equal to the current buffer depth or stencil at the fragment's coordinates.

EQUAL

Pass the depth or stencil test if the incoming fragment's depth is equal to the current buffer depth or stencil at the fragment's coordinates.

NOTEQUAL

Pass the depth or stencil test if the incoming fragment's depth is not equal to the current buffer depth or stencil at the fragment's coordinates.

ALWAYS

Always pass the depth or stencil test for any fragment (default).

Enable or disable stencil testing.

Enumerator:

STENCIL_ON

Enable stencil testing.

STENCIL_OFF

Disable stencil testing.

Lists all possible stencil operations.

Enumerator:

STENCIL_OP_KEEP

Stencil operation. Keep existing stencil value unchanged.

STENCIL_OP_ZERO

Stencil operation. Set stencil value to zero.

STENCIL_OP_REPLACE

Stencil operation. Replace stencil value by incoming stencil value.

STENCIL_OP_INCR

Stencil operation. Increment stencil buffer by 1.

STENCIL_OP_DECR

Stencil operation. Decrement stencil buffer by 1.

STENCIL_OP_INVERT

Stencil operation. Invert bits in stencil buffer values.

Select the kind of transparency we should use for the shader.

Enumerator:

NO_TRANSPARENCY

The name says it.

MASKED_TRANSPARENCY

This is a fake transparency. The texture specified in RED::StateShader::SetMaskedTransparency is used as a filter for the fragments to render. There's no blending at all as the transparency result is a binary 0 / 1 value. Ray-traced shadows are defined by the masking texture's alpha intensity.

SORTED_TRANSPARENCY

Blended transparency. The color or transparency texture is specified by RED::StateShader::SetSortedTransparency. Ray-traced shadows are defined by the color of the transparency, or by the texture's color modulated by the texture's alpha.

SORTED_AND_MASKED_TRANSPARENCY

The texture's alpha value is used to mask the pixel regions where the fragments are rendered. This combines both transparency modes, using the single texture specified with RED::StateShader::SetSortedAndMaskedTransparency. Ray-traced shadows are computed as for the RED::StateShader::SORTED_TRANSPARENCY mode.