Skip to content

alphaMask(inputColor, maskTex, maskUV, strength?): Node <"vec4">

Defined in: packages/nodes/src/alpha/alphaMask.ts:24

Multiply alpha by a mask texture’s value. The mask texture’s red channel (or luminance) is used as the mask value.

Node <"vec4">

The input color (vec4 with alpha)

Texture 

Mask texture (uses red channel)

Node <"vec2">

UV coordinates for mask sampling

FloatInput = 1

Mask strength (0 = no mask, 1 = full mask)

Node <"vec4">

Color with masked alpha

// Apply mask texture
alphaMask(texture(tex, uv()), maskTexture, uv())
// Partial mask effect
alphaMask(texture(tex, uv()), maskTexture, uv(), 0.5)