Windfoil: Closed-Form Coverage for Real-Time and Differentiable Vector Graphics

Open original

Windfoil is a GPU algorithm that handles vector graphics rasterization and differentiable rendering using closed-form winding number calculations for Bézier curves. It runs in WebGPU across browsers and devices, outperforming production renderers like Skia on accuracy while matching the speed of game-focused alternatives.

  • Achieves better coverage fidelity than Skia and Slug while maintaining comparable performance to Slug on real-time tasks
  • Scales to tens of thousands of shapes at interactive rates, outperforming DiffVG and Bézier Splatting on optimization cost per step
  • Works across environments from web browsers to high-resolution print rendering through a single WebGPU implementation

Windfoil solves a real problem in vector graphics rendering: how to draw smooth, scalable graphics fast on GPUs while also making the process differentiable (meaning you can optimize the graphics by adjusting parameters). The core trick is computing the winding number—a mathematical concept that determines whether a point is inside or outside a shape—in closed form for quadratic Bézier curves. This lets them calculate pixel coverage accurately without expensive approximations. They built it in WebGPU so it runs anywhere from a browser on a laptop to professional workstations, hitting three use cases: real-time 2D rendering, high-res print output, and graphics you can optimize automatically. When they tested against established competitors, the results were solid. Skia is the industry standard for graphics (used in Chrome, Android, etc.), and Slug is what games rely on for fast GPU rasterization. Windfoil matched their output more accurately than either when measured against a reference standard for box-filtered coverage, while keeping speed comparable to Slug. That's the sweet spot—better quality without sacrificing performance. On the optimization side, they compared against DiffVG and Bézier Splatting, two existing tools for tweaking vector graphics computationally. Windfoil got the same or better reconstruction quality per optimization step while running much faster. It scales to tens of thousands of shapes while staying interactive, which matters if you're trying to automatically design or refine complex graphics. The WebGPU implementation means you're not locked into a specific platform or hardware vendor.

Ask about this article