16 releases

new 0.2.7 May 31, 2023
0.2.5 Feb 13, 2023
0.2.4 Oct 9, 2022
0.2.1 Jul 18, 2022
0.1.4 Mar 27, 2022

#111 in Graphics APIs

Download history 117/week @ 2023-02-12 118/week @ 2023-02-19 14/week @ 2023-02-26 32/week @ 2023-03-05 14/week @ 2023-03-12 19/week @ 2023-03-19 26/week @ 2023-03-26 30/week @ 2023-04-02 26/week @ 2023-04-09 33/week @ 2023-04-16 23/week @ 2023-04-23 29/week @ 2023-04-30 57/week @ 2023-05-07 21/week @ 2023-05-14 18/week @ 2023-05-21 94/week @ 2023-05-28

194 downloads per month
Used in rui

MIT license

1.5K SLoC


build status dependency status

vger is a vector graphics renderer which renders a limited set of primitives, but does so almost entirely on the GPU. Port of VGER to Rust. Used in rui.


  • ✅ Quadratic bezier strokes
  • ✅ Round Rectangles
  • ✅ Circles
  • ✅ Line segments (need square ends for Audulus)
  • ✅ Arcs
  • ✅ Text (Audulus only uses one font, but could add support for more if anyone is interested)
  • ✅ Multi-line text
  • ✅ Path Fills.
  • ✅ Scissoring
  • ❌ Images


I was previously using nanovg for Audulus, which was consuming too much CPU for the immediate-mode UI. nanovg is certainly more full featured, but for Audulus, vger maintains 120fps while nanovg falls to 30fps on my 120Hz iPad because of CPU-side path tessellation, and other overhead. vger renders analytically without tessellation, leaning heavily on the fragment shader.

How it works

vger draws one or more quads for each primitive and computes the actual primitive shape in the fragment function with an SDF. For path fills, vger splits paths into horizontal slabs (see path.rs) to reduce the number of tests in the fragment function.

The bezier path fill case is somewhat original. To avoid having to solve quadratic equations (which has numerical issues), the fragment function uses a sort-of reverse Loop-Blinn. To determine if a point is inside or outside, vger tests against the lines formed between the endpoints of each bezier curve, flipping inside/outside for each intersection with a +x ray from the point. Then vger tests the point against the area between the bezier segment and the line, flipping inside/outside again if inside. This avoids the pre-computation of Loop-Blinn, and the AA issues of Kokojima.


Text Rendering Hates You

Adventures in Text Rendering

Vector Graphics on GPU

GPU UIs at 120 FPS


~632K SLoC