We have an application which needs to render spline curves (cubic, bezier, b-spline etc.). We currently have working algorithms in C to stroke the control points of these curves into line strips.
The issue we are running to is the need to constantly re-stroke the curves based on zoom and how much of the curve is visible. I am guessing this would be both more practical and more efficient to do on the GPU.
What is the most standard way to approach this problem? I have heard about Geometry shaders but have also heard they are inefficient so I'm not sure if there is maybe a better way. If not, what is the general process of stroking curves like this?
In general, the stroking algorithms take in the control points of the curves, and determine a new set of points for a line strip (based on a tolerance calculated from the zoom level, which defines the stroking interval).
We are using Vulkan if it makes any difference. Thanks!