Skip to content

alphaTest(inputColor, threshold): Node <"vec4">

Defined in: packages/nodes/src/alpha/alphaTest.ts:21

Discard pixels with alpha below a threshold. Useful for hard-edged transparency (pixel art, text).

Node <"vec4">

The input color (vec4 with alpha)

FloatInput

Alpha threshold (pixels below this are discarded)

Node <"vec4">

Color unchanged, or discarded if below threshold

// Discard nearly transparent pixels
alphaTest(texture(tex, uv()), 0.5)
// Animated alpha cutoff
alphaTest(texture(tex, uv()), thresholdUniform)