Windfoil Brings Exact Vector Rendering and AI Fitting to WebGPU
A single closed-form math trick turns 2D rasterisation and gradient-based vector graphics into the same WebGPU shader, outperforming DiffVG and matching Slug.
- Windfoil computes box-filtered winding numbers of quadratic Bézier contours in closed form on the GPU.
- Single WebGPU shader serves both real-time rasterisation and differentiable optimisation pipelines.
- Matches reference coverage more closely than Skia and Slug at Slug-like speeds.
- Beats DiffVG and Bézier Splatting on per-step cost with equal or better reconstruction quality.
- Scales to 50,000 shapes fitted by gradient descent on mean-squared pixel error.
- Code and demos available at texel-org/windfoil-paper, runs in browser via Deno.
Windfoil brings analytic Bézier coverage to WebGPU
A Windfoil paper by Matt DesLauriers presents a WebGPU renderer that calculates per-pixel coverage for quadratic Bézier shapes with a closed-form method. The same analytic kernel supports interactive rasterisation and gradient-based image fitting in browsers or server-side Deno, with reported performance on a consumer laptop.
Vector rasterisers need accurate coverage values to produce smooth edges, while differentiable renderers also need derivatives that connect output pixels to path parameters. Windfoil addresses both requirements with one coverage function, reducing the sampling cost and gradient noise associated with earlier differentiable approaches.
Coverage becomes an integral
Each output pixel needs a fractional coverage value describing how much of its square area lies inside a path. Inaccurate estimates create jagged edges and temporal shimmer; discontinuous or noisy estimates also make gradient descent harder to use.
Windfoil calculates coverage from the box-filtered winding number. A winding number counts how many times a contour wraps around a point, which determines whether that point belongs to the filled region. Averaging that value across the square footprint of a pixel produces its antialiased coverage.
A quadratic Bézier segment consists of two endpoints and one control point. Windfoil integrates the winding contribution of these segments over each pixel footprint in closed form. The paper describes the result as exact for well-formed quadratic contours under its stated assumptions, avoiding repeated subpixel samples and signed-distance approximations.
This story is for Pro members
You've reached the end of the free preview. Upgrade to AlphaSignal Pro to read the full article - and everything else behind the paywall.