Skip to content

hq2x(tex, uv, texelSize?, threshold?): Node <"vec4">

Defined in: packages/nodes/src/upscale/hq2x.ts:22

HQ2x-style pixel art upscaling (simplified GPU implementation). High quality 2x upscaling that preserves edges while smoothing.

Note: This is a simplified approximation of the full HQ2x algorithm, which requires lookup tables that are impractical for real-time GPU shaders.

Texture 

Source texture (pixel art)

Node <"vec2">

UV coordinates

Vec2Input = ...

Size of one texel in source texture

FloatInput = 0.05

Color difference threshold (default: 0.05)

Node <"vec4">

Upscaled color

const upscaled = hq2x(texture, uv, [1/256, 1/256])