Swingline is a fast, pure-GPU implementation of Weighted Voronoi Stippling using Lloyd's algorithm. By offloading both the Voronoi diagram rendering and the cell centroid computation to the GPU, it achieves 10-20x speedups over StippleGen for small sample counts and handles 10K samples where StippleGen hangs entirely. The technique renders uniquely-colored cones with depth culling to construct the Voronoi diagram, then uses a two-stage GPU shader pipeline (horizontal accumulation + vertical summing with transform feedback) to compute weighted centroids. The result is output as SVG stipple art. Implemented in under 900 lines of C using OpenGL, GLFW, and libepoxy.

5m read timeFrom mattkeeter.com
Post cover image
Table of contents
AboutRendering the Voronoi diagramFinding weighted cell centroidsImplementation and UsageFurther Reading

Sort: