Skip to content

scale2x

scale2x(tex, uv, texelSize): Node<"vec4">

Defined in: packages/nodes/src/upscale/scale2x.ts:19

Scale2x (AdvMAME2x) pixel art upscaling algorithm. Simple edge-detection based upscaling that preserves pixel art edges.

Parameters

tex

Texture

Source texture (pixel art)

uv

Node<"vec2">

UV coordinates

texelSize

Vec2Input = ...

Size of one texel in the source texture

Returns

Node<"vec4">

Upscaled color

Example

// For a 256x256 texture upscaled to 512x512
const upscaled = scale2x(texture, uv, [1/256, 1/256])