Table of Contents
Fetching ...

GPU-friendly Stroke Expansion

Raph Levien, Arman Uguray

TL;DR

The paper tackles efficient, correct GPU stroke expansion for vector graphics by introducing Euler spirals as a universal intermediate representation and by developing invertible error metrics to drive adaptive subdivision. It delivers a fully GPU-driven pipeline with a compact input encoding, enabling both line and arc outputs that support strong correctness including evolute handling. The approach yields significant speedups over CPU-based methods across diverse hardware, while maintaining visual fidelity within predefined tolerances. This work provides a practical framework for real-time rendering of stroked paths on commodity GPUs, with implications for scalable vector graphics pipelines and GPU-based rendering engines.

Abstract

Vector graphics includes both filled and stroked paths as the main primitives. While there are many techniques for rendering filled paths on GPU, stroked paths have proved more elusive. This paper presents a technique for performing stroke expansion, namely the generation of the outline representing the stroke of the given input path. Stroke expansion is a global problem, with challenging constraints on continuity and correctness. Nonetheless, we implement it using a fully parallel algorithm suitable for execution in a GPU compute shader, with minimal preprocessing. The output of our method can be either line or circular arc segments, both of which are well suited to GPU rendering, and the number of segments is minimal. We introduce several novel techniques, including an encoding of vector graphics primitives suitable for parallel processing, and an Euler spiral based method for computing approximations to parallel curves and evolutes.

GPU-friendly Stroke Expansion

TL;DR

The paper tackles efficient, correct GPU stroke expansion for vector graphics by introducing Euler spirals as a universal intermediate representation and by developing invertible error metrics to drive adaptive subdivision. It delivers a fully GPU-driven pipeline with a compact input encoding, enabling both line and arc outputs that support strong correctness including evolute handling. The approach yields significant speedups over CPU-based methods across diverse hardware, while maintaining visual fidelity within predefined tolerances. This work provides a practical framework for real-time rendering of stroked paths on commodity GPUs, with implications for scalable vector graphics pipelines and GPU-based rendering engines.

Abstract

Vector graphics includes both filled and stroked paths as the main primitives. While there are many techniques for rendering filled paths on GPU, stroked paths have proved more elusive. This paper presents a technique for performing stroke expansion, namely the generation of the outline representing the stroke of the given input path. Stroke expansion is a global problem, with challenging constraints on continuity and correctness. Nonetheless, we implement it using a fully parallel algorithm suitable for execution in a GPU compute shader, with minimal preprocessing. The output of our method can be either line or circular arc segments, both of which are well suited to GPU rendering, and the number of segments is minimal. We introduce several novel techniques, including an encoding of vector graphics primitives suitable for parallel processing, and an Euler spiral based method for computing approximations to parallel curves and evolutes.
Paper Structure (25 sections, 14 equations, 20 figures, 4 tables, 2 algorithms)

This paper contains 25 sections, 14 equations, 20 figures, 4 tables, 2 algorithms.

Figures (20)

  • Figure 1: Illustration of stroke styles applied to a source Bézier path (shown in black).
  • Figure 2: Example of weakly correct (top) and strongly correct (bottom) stroke rendering. The left example has a curvature cusp and requires evolutes to render correctly, while the right requires the inner join.
  • Figure 3: A circular arc segment with notations for angles ($\theta$), arc length ($s$), and distance to chord ($d$)
  • Figure 4: The flattened approximation to an Euler spiral using line segments is achieved by choosing subdivision points using a simple power law formula with an exponent of 2/3.
  • Figure 5: Comparison of error metrics. Top row (a) shows a distance based error metric. Bottom row (b) shows the angle step error metric.
  • ...and 15 more figures