Skip to content

outline

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.

Parameters

inputColor

Node<"vec4">

The input color (typically texture sample result)

inputUV

Node<"vec2">

The UV coordinates

tex

Texture

The texture to sample for neighbor detection

options

OutlineOptions = {}

Outline configuration

Returns

Node<"vec4">

Color with outline applied

Examples

// 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]
})