Yeah, it is hard to do properly. Been looking into several different methods and implementations, and this is the one I went with on my project (missing from the article):
This is a very throughout implementation with many different drawing features and beautiful results. The actual implementation provided with the Python examples is a bit difficult to understand and not perhaps the most optimal, but still the paper and the theory behind it is one of the most comprehensive I've found.
I wish OpenVG/NV_path_rendering were more supported, especially on mobile platforms where they're needed the most. I'm making an app that involves hardware-accelerated line/path rendering and dealing with triangulation, color, batching, stroke vs. fill, patterns, etc. manually is a pain. Libraries like MonkVG and nanovg exist but they're a little half-baked at the moment.
If anyone has seen the alpha spec and isn't under NDA, I'd be very interested to know whether OpenVG/NV_path_rendering could be efficiently implemented as libraries on top of Vulkan, given that it's a lot lower-level than GL.
I remember from Mark Kilgard's notes that NV_path_rendering on top of the stock OpenGL pipeline wasn't feasible, which pretty much killed it for general usage. Fantastic functionality, but nobody outside NVIDIA was ever going to implement that extension; the thing was gigantic.
Yes, but it's a good idea. And there's plenty of software that relies on hardware-accelerated vectors: maps, browsers, animations, games, etc. The problem is that everyone has their own implementation!
By some wonderful coincidence I need to implement antialiased line rendering this afternoon. Previously I'd done the 6-triangle method (but I also rasterized any kind of path with all sorts of fancy fills, and it made more sense for that).
Thanks for such a clear write-up and all the links.
Yep! Our fullstack / GPU / infrastructure spots are full (team of 5), but we've been holding two spots open here:
* infoviz lead: handling design+impl of high-density data viz (imagine interacting with million node graphs). Coding-wise, clientside WebGL, D3, and serverside, node + c + opencl + our custom (GP)GPU cluster stack. It'll involve pushing what's possible in data viz, both in design & performance.
* frontend lead: UX/app/product design, meaning JS/CSS/whatever frameworks you want to bring in (e.g., React). GL is not necessary, but you'll probably want to get your hands dirty.
Msg build@graphistry.com and we can figure it out!
Anyone know the reason behind this? I'm guessing it's sort of triangle bounding error where something is being divided by a tiny divisor. It happens when I draw the snake in an arc, then retrace the arc from the same angle but in the opposite direction.
Note: a drawback that comes with miter-joined lines is sharp edges. When the angle connecting two segments is very sharp, the miter length grows exponentially toward infinity, and causes huge artifacts in rendering. In some applications this may not be a problem, in others you might want to limit the miter or fall back to another join (i.e. bevel) when the angle is too sharp.
there is a solution to this called 'mitre limiting' its quite simple really. beyond a certain angle (dot product) threshold between adjacent segments you don't mitre the corner, but you 'cap' it, either with a simple triangle filling the gap, or with a fan to create a nice, rounded appearance.
I wrote some animated SVG's in the past. It was often slow but good enough for most tasks. Quality was/is browser-dependent, but it worked well in overall.
I'm not sure what people want to achieve. So, how well works Scalable Vector Graphics for you?
Shader-Based Antialiased, Dashed, Stroked Polylines http://jcgt.org/published/0002/02/08/
This is a very throughout implementation with many different drawing features and beautiful results. The actual implementation provided with the Python examples is a bit difficult to understand and not perhaps the most optimal, but still the paper and the theory behind it is one of the most comprehensive I've found.