Create a new BlendState instance.
All factor parameters can take the following values:
All op parameters can take the following values:
Note that MIN and MAX operations on WebGL platform require either EXT_blend_minmax or WebGL2 to work (check device.extBlendMinmax).
Optional
blend: boolean = falseEnables or disables blending. Defaults to false.
Optional
colorOp: number = BLENDEQUATION_ADDConfigures color blending operation. Defaults to BLENDEQUATION_ADD.
Optional
colorSrcFactor: number = BLENDMODE_ONEConfigures source color blending factor. Defaults to BLENDMODE_ONE.
Optional
colorDstFactor: number = BLENDMODE_ZEROConfigures destination color blending factor. Defaults to BLENDMODE_ZERO.
Optional
alphaOp: numberConfigures alpha blending operation. Defaults to BLENDEQUATION_ADD.
Optional
alphaSrcFactor: numberConfigures source alpha blending factor. Defaults to BLENDMODE_ONE.
Optional
alphaDstFactor: numberConfigures destination alpha blending factor. Defaults to BLENDMODE_ZERO.
Optional
redWrite: boolean = trueTrue to enable writing of the red channel and false otherwise. Defaults to true.
Optional
greenWrite: boolean = trueTrue to enable writing of the green channel and false otherwise. Defaults to true.
Optional
blueWrite: boolean = trueTrue to enable writing of the blue channel and false otherwise. Defaults to true.
Optional
alphaWrite: boolean = trueTrue to enable writing of the alpha channel and false otherwise. Defaults to true.
Static
Readonly
ADDBLENDA blend state that does simple additive blending.
Static
Readonly
ALPHABLENDA blend state that does simple translucency using alpha channel.
Static
Readonly
NOBLENDA blend state that has blending disabled and writes to all color channels.
Static
Readonly
NOWRITEA blend state that does not write to color channels.
Gets whether blending is enabled.
Sets whether blending is enabled.
Returns an identical copy of the specified blend state.
The result of the cloning.
Copies the contents of a source blend state to this blend state.
A blend state to copy from.
Self for chaining.
Reports whether two BlendStates are equal.
The blend state to compare to.
True if the blend states are equal and false otherwise.
BlendState is a descriptor that defines how output of fragment shader is written and blended into render target. A blend state can be set on a material using Material#blendState, or in some cases on the graphics device using GraphicsDevice#setBlendState.
For the best performance, do not modify blend state after it has been created, but create multiple blend states and assign them to the material or graphics device as needed.