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