hn.today

Slughorn – GPU Vector Graphics

slughorn.io3 points0 comments
Screenshot of Slughorn – GPU Vector Graphics

Slughorn is a modern C++20 library for GPU-accelerated vector graphics, built around the Slug technique. It can ingest artwork from SVG, FreeType, Blend2D, Cairo, and Skia, or let developers create shapes directly through its native Canvas API. The site presents it as a tool for graphics and simulation projects ranging from embedded HUDs to complex 3D scenes, with support for uploading its output to OpenGL, Vulkan, WebGPU, DirectX, and other graphics backends. Python bindings are also available, alongside the C++ API.

The examples show how to combine fills, strokes, gradients, and layered composite shapes, including using opposite winding to cut a hole through a shape. Shapes are compiled into an atlas of curve and band textures; the costly preparation happens when the atlas is built, so the runtime GPU pipeline avoids tessellation. The Canvas API is designed to feel familiar to browser-canvas users while producing data ready for GPU upload. Documentation includes API and architecture references, backend integration guidance, and Python documentation, while the repository provides build instructions and contribution information. The project is MIT-licensed, and its site also links to examples, a development roadmap, sponsorship options, and osgSlug, an OpenSceneGraph companion.

Read on slughorn.io0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.