C4 Engine Terathon Software C4 Engine API Documentation

• Graphics Manager

API Links
Developer Links

Renderable::SetBlendState

Defined in:  C4Renderable.h
Sets the ambient pass blend state.
Prototype

void SetBlendState(unsigned long state);

Parameters
state The new ambient pass blend state.
Description
The SetBlendState function sets the blending function used when an object is rendered in the ambient pass. The state parameter encodes the blending factors and can be constructed using the BlendState function. The first two parameters of the BlendState function specify one of the following constants for the source blend factor and the destination blend factor, respectively.
kBlendZero Zero.
kBlendOne One.
kBlendSourceColor Source color.
kBlendDestColor Destination color.
kBlendSourceAlpha Source alpha.
kBlendDestAlpha Destination alpha.
kBlendInvSourceColor One minus source color.
kBlendInvDestColor One minus destination color.
kBlendInvSourceAlpha One minus source alpha.
kBlendInvDestAlpha One minus destination alpha.
For example, BlendState(kBlendOne, kBlendZero) returns the blend state corresponding to replacement of the destination color by the source color. BlendState(kBlendOne, kBlendOne) adds the source color to the destination color.

There are several predefined constants that can also be passed to the state parameter, listed below.
kBlendReplace Replace the destination color with the source color.
kBlendAccumulate Add the source color to the destination color.
kBlendModulate Multiply the destination color by the source color.
kBlendInterpolate Interpolate between the source and destination colors using the source alpha.
See Also

Renderable::GetBlendState