I wrote an implementation based on this a few weeks back. It works really nicely and I can render some 2M line segments at 60fps.<p>One thing you should do is try to limit very short and small segments, as GPUs don’t like rendering 1px triangles.<p>Still, I’ve been lead to understand that the instanced rendering done in this article is suboptimal on most GPUs. A better way to do it is apparently to put the points into a (non-vertex) buffer and do (batched) drawcalls for large numbers of vertices with a kind of manual instancing. Basically looking up what amounts to instance data using gl_VertexInput/6 and vertex data using gl_VertexIndex%6 (or 4 instead of 6 for indexes rendering).<p>Unfortunately I haven’t had the time to implement and test this yet.<p>If like me you’re also rendering lines with perspective, you want to also look at Freya Holmer's work. Particularly line thinness fading is important to reduce shimmer/aliasing. This means basically keep the width at a minimum of 1px and adjusting opacity below that instead.<p>Edit: For those interested, mine is implemented as a plugin to the Bevy game engine, written in Rust. Bevy can be found here <a href="https://github.com/bevyengine/bevy" rel="nofollow">https://github.com/bevyengine/bevy</a>. The plugin is <a href="https://github.com/ForesightMiningSoftwareCorporation/bevy_polyline" rel="nofollow">https://github.com/ForesightMiningSoftwareCorporation/bevy_p...</a>.