alphaTest
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).
Parameters
inputColor
Node<"vec4">
The input color (vec4 with alpha)
threshold
Alpha threshold (pixels below this are discarded)
Returns
Node<"vec4">
Color unchanged, or discarded if below threshold
Examples
// Discard nearly transparent pixelsalphaTest(texture(tex, uv()), 0.5)// Animated alpha cutoffalphaTest(texture(tex, uv()), thresholdUniform)