title: Rendering Blended Lines In OpenGL
body: <p>I would like to draw a large number of quads, each representing a small segment of a curve, so that the curve appears smooth but is really made up of just linear pieces.  I also want to be able to set both the thickness of the line and a thickness for a blended part of the line, such that in the blended region the line linearly loses its alpha component.  Ideally these lines would be able to be oriented in any way in a 3D scene, though they will most often be in a plane facing the camera.  </p>
  
  <p>The problem is that it is that it's hard to blend the line with the background without having the overlapping segments interact with each other, becoming brighter where many overlap.  I only want 1 fragment of the line to blend with the background, but it's hard to know which fragment is the correct one if you render each quad separately.  </p>
  
  <p>Is there an efficient way to do something like this?  Or do I have to do some kind of pre-processing to turn the line into 1 mesh instead of rendering it as a bunch of quads?</p>
  
  <p>[Here is a picture of the problem with the lines intersecting each other &amp; not blending correctly]</p>
  
  <p><a href="https://i.imgur.com/8cYm1zK.png" rel="nofollow noreferrer">http://i.imgur.com/8cYm1zK.png</a></p>
  
  <p>Here is a related problem, but it's different because I want to blend the quads so that they fall off linearly.  If you implement the solution from this thread, then the blending will look incorrect.</p>
  
  <p><a href="https://stackoverflow.com/questions/10183311/opengl-blending-function-to-elminate-primitive-overlap-but-maintain-overall-opac?rq=1">OpenGL blending function to elminate primitive overlap but maintain overall opacity</a></p>