Skip to content

alphaMask

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.

Parameters

inputColor

Node<"vec4">

The input color (vec4 with alpha)

maskTex

Texture

Mask texture (uses red channel)

maskUV

Node<"vec2">

UV coordinates for mask sampling

strength

FloatInput = 1

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

Returns

Node<"vec4">

Color with masked alpha

Examples

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