BlendMode

View source

Provides numeric choices for the source and destination factors used by WebGL blending.

Pass a pair of values to gl.blendFunc. WebGL uses them to scale the source and destination contributions before BlendEquation combines them.

Examples

import { BlendMode } from '@wimaengine/render-webgl'

// `gl` is an existing WebGL rendering context.
gl.blendFunc(BlendMode.SRC_ALPHA, BlendMode.ONE_MINUS_SRC_ALPHA)

Variants


ZERO

View source

Uses zero for the selected source or destination factor (0x0000).

ONE

View source

Uses one for the selected source or destination factor (0x0001).

SRC_COLOR

View source

Uses the source color as the factor (0x0300).

ONE_MINUS_SRC_COLOR

View source

Uses one minus the source color as the factor (0x0301).

SRC_ALPHA

View source

Uses the source alpha as the factor (0x0302).

ONE_MINUS_SRC_ALPHA

View source

Uses one minus the source alpha as the factor (0x0303).

DST_ALPHA

View source

Uses the destination alpha as the factor (0x0304).

ONE_MINUS_DIST_ALPHA

View source

Uses one minus the destination alpha as the factor (0x0305).

The exported member is named ONE_MINUS_DIST_ALPHA.

DST_COLOR

View source

Uses the destination color as the factor (0x0306).

ONE_MINUS_DST_COLOR

View source

Uses one minus the destination color as the factor (0x0307).

SRC_ALPHA_SATURATE

View source

Uses min(source alpha, 1 - destination alpha) for the RGB source factor (0x0308). The source alpha factor is 1.

CONSTANT_COLOR

View source

Uses the constant blend color as the factor (0x8001).

ONE_MINUS_CONSTANT_COLOR

View source

Uses one minus the constant blend color as the factor (0x8002).

CONSTANT_ALPHA

View source

Uses the constant blend alpha as the factor (0x8003).

ONE_MINUS_CONSTANT_ALPHA

View source

Uses one minus the constant blend alpha as the factor (0x8004).