'MOst efficient way to draw line graph based on shaders

I need to draw line graph with more than one million points, which will looks like this:

example

So I'm looking for the most efficient way to achieve this. After days of brainstorming, we decided to go with shaders because it utilizes GPU and should be performant enough to show my graph with millions of point with 20+ fps.

To eliminate problems with geometry during visualization, I guess shader should looks like this:

shader geometry

So, is it right direction I'm looking or there are more efficient ways exist?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source