Skip to content

Documentation / device / BlendingState

Interface: BlendingState ​

Defined in: libs/device/src/render_states.ts:60

The render states related to alpha blending

Properties ​

enabled ​

enabled: boolean

Defined in: libs/device/src/render_states.ts:64

true if alpha blending is enabled


alphaToCoverageEnabled ​

alphaToCoverageEnabled: boolean

Defined in: libs/device/src/render_states.ts:66

true if alpha to coverage is enabled


srcBlendRGB ​

srcBlendRGB: BlendFunc

Defined in: libs/device/src/render_states.ts:68

The source blending factor for RGB channels


dstBlendRGB ​

dstBlendRGB: BlendFunc

Defined in: libs/device/src/render_states.ts:70

The destination blending factor for RGB channels


srcBlendAlpha ​

srcBlendAlpha: BlendFunc

Defined in: libs/device/src/render_states.ts:72

The source blending factor for alpha channel


dstBlendAlpha ​

dstBlendAlpha: BlendFunc

Defined in: libs/device/src/render_states.ts:74

The destination blending factor for alpha channel


rgbEquation ​

rgbEquation: BlendEquation

Defined in: libs/device/src/render_states.ts:76

The blending equation for RGB channels


alphaEquation ​

alphaEquation: BlendEquation

Defined in: libs/device/src/render_states.ts:78

The blending equation for alpha channel

Methods ​

clone() ​

clone(): BlendingState

Defined in: libs/device/src/render_states.ts:62

Creates a new BlendingState by copying this one

Returns ​

BlendingState


enable() ​

enable(b): this

Defined in: libs/device/src/render_states.ts:84

Enable or disable alpha blending

Parameters ​

b ​

boolean

true if enable

Returns ​

this

self


enableAlphaToCoverage() ​

enableAlphaToCoverage(b): this

Defined in: libs/device/src/render_states.ts:90

Enable or disable alpha to coverage

Parameters ​

b ​

boolean

true if enable

Returns ​

this

self


setBlendFunc() ​

setBlendFunc(src, dest): this

Defined in: libs/device/src/render_states.ts:97

Sets the blending function for both RGB channels and the alpha channel

Parameters ​

src ​

BlendFunc

The source blending function

dest ​

BlendFunc

The destination blending function

Returns ​

this

self


setBlendFuncRGB() ​

setBlendFuncRGB(src, dest): this

Defined in: libs/device/src/render_states.ts:104

Sets the blending function for RGB channels

Parameters ​

src ​

BlendFunc

The source blending function

dest ​

BlendFunc

The destination blending function

Returns ​

this

self


setBlendFuncAlpha() ​

setBlendFuncAlpha(src, dest): this

Defined in: libs/device/src/render_states.ts:111

Sets the blending function for the alpha channel

Parameters ​

src ​

BlendFunc

The source blending function

dest ​

BlendFunc

The destination blending function

Returns ​

this

self


setBlendEquation() ​

setBlendEquation(rgb, alpha): this

Defined in: libs/device/src/render_states.ts:118

Sets the blending equations for RGB channels and the alpha channel

Parameters ​

rgb ​

BlendEquation

The blending equation for RGB channels

alpha ​

BlendEquation

The blending equation for the alpha channel

Returns ​

this

self

Released under the MIT License.