Skip to content

outline(inputColor, inputUV, tex, options?): Node <"vec4">

Defined in: packages/nodes/src/sprite/outline.ts:37

Add an outline effect by sampling neighboring pixels. Detects edges based on alpha differences and draws outline around opaque areas.

Node <"vec4">

The input color (typically texture sample result)

Node <"vec2">

The UV coordinates

Texture 

The texture to sample for neighbor detection

OutlineOptions = {}

Outline configuration

Node <"vec4">

Color with outline applied

// Basic white outline
outline(texture(tex, uv()), uv(), tex, { color: [1, 1, 1, 1] })
// Glowing outline with custom thickness
outline(texture(tex, uv()), uv(), tex, {
color: [0, 1, 0, 1],
thickness: 0.02,
textureSize: [64, 64]
})