hq2x
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.
Parameters
tex
Source texture (pixel art)
uv
Node<"vec2">
UV coordinates
texelSize
Vec2Input = ...
Size of one texel in source texture
threshold
FloatInput = 0.05
Color difference threshold (default: 0.05)
Returns
Node<"vec4">
Upscaled color
Example
const upscaled = hq2x(texture, uv, [1/256, 1/256])