Implementing GPU-driven line rendering
In this recipe, you will learn a technique that allows drawing lines directly from shaders such as vertex or fragment shaders. In many graphics applications, the challenge arises when one wishes to draw lines directly and efficiently using the inherent capabilities of shaders, particularly vertex or fragment shaders. To address this, our recipe delves into a specialized technique tailored for this very purpose. We’ll be presenting a recipe that seamlessly integrates with a variety of pipelines and render passes. Through our approach, data, be it vertices or colors, gets stored in a device buffer, ensuring a streamlined process. The culmination of this procedure is the utilization of this accumulated data in a subsequent pass, where these lines are then masterfully rendered onto a framebuffer. By the end, you will have a robust and efficient method to directly render lines using shaders.
Getting ready
Before diving into the recipe...