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