Skip to content

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.

Texture 

Source texture (pixel art)

Node <"vec2">

UV coordinates

Vec2Input = ...

Size of one texel in the source texture

Node <"vec4">

Upscaled color

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