TextureMind Framework – Progress #34 – GPU Path Rendering

GPU-accelerated path (or VG) rendering is one of the features missing from modern graphics libraries, which allow polygons rasterization but not shapes composed of curves. Modern graphic design is characterized by text using high-resolution fonts and rounded shapes. In some cases, these shapes can be created using polygons or textures, though this requires more effort and not always it's possible. GPU-based curve rendering becomes essential if the goal is to support the rendering of rounded shapes with a modern design. Implementing this feature on the GPU requires significant design and programming effort using shader languages.

I reimplemented all the Cairo functionalities for drawing curves and splines with the GPU. The shapes are splitted into polygons with 4-points Bezier curves rendered with signed distance functions (SDF). The new engine can work with Vulkan and OpenGL, it has support for antialiasing, thickness, caps and edges, it can fill the shapes with colors, textures, linear and radial patterns, or shaders. As you can see from this screenshot, there is no visual difference between Vulkan and OpenGL. This new feature will enable GPU-accelerated rendering of outline fonts and rounded shapes, and will give a modern look to the GUI, which I intend to completely redesign.

Leave a Reply