4 ms·
Drawing lines in OpenGL & 3d hardware in general has always had some of these issues. The best support for GL/OpenGL line drawing I knew of was in the more expe
by dahart 10y ago
Drawing lines in OpenGL & 3d hardware in general has always had some of these issues. The best support for GL/OpenGL line drawing I knew of was in the more expensive SGI machines. (Capitalized on purpose to indicate before they rebranded lowercase -- but this is fuzzy memory and I'm no sgi history expert.) The cheaper ones' lines definitely weren't as good, but SGIs did have pretty nice line support back in the day, better than what you get in WebGL today.
One thing I didn't see mentioned here is the line drawing API calls are typically not as well optimized as the triangle mesh calls, or so I've heard. Part of the reason good line drawing support was more expensive was (allegedly) only a few customers truly need antialiased lines with performance as good as the mesh API, and it's extra silicon, lines have specific needs not shared with meshes.
FWIW, I've tried all these approaches in production and ended up just doing the meshing myself, and avoiding shader tricks. It's not that bad, it gives the most control, and once you have an abstraction for it, you don't need to think about it again.
- vvanders 10y agoFor us screen space worked a bit better but I'm sure it varies by use case. Getting the right fall-off on non-aligned pixels is always tricky(including 0.5f offset in Direct3D).