title: Best Method for Vertex Selection in OpenGL 4
body: <p>I found this post, which is sort of answering my question, but not completely:</p>
  
  <p><a href="https://stackoverflow.com/questions/7238518/how-to-drag-the-line-segment-by-selecting-the-vertex">How to drag the line segment by selecting the vertex</a></p>
  
  <p>What I am trying to resolve: a modern way (using OpenGL 4 architecture) of performing vertex selection:</p>
  
  <ul>
  <li>a user draws a selection (rubber band, that's not what I am after)</li>
  <li>I assume at this stage I can give some sort of unique ID to each vertex in the model</li>
  <li>the selected region is somehow re-rendered, off-line using some sort of vertex/fragment shader that would store the vertices in a buffer that I could read back?</li>
  </ul>
  
  <p>I am just guessing it involves some sort of buffer in which the shaders can write the result of the rendered vertices in, buffer which is readable in the program. I wonder if someone has done that already or could at least orient me in the right direction. It needs to be (ideally) fast (working on very large models), and use OpenGL4 (no deprecated features such as GL_SELECT, etc.).</p>
  
  <ul>
  <li>ideally, I'd also need to use the same technique to select other components such as edges and faces. </li>
  </ul>