title: Vertex Shader Particle Movement
body: <p>I want to move my particles by a few given attributes. The particles should slow down to a stop as they reach the end of their lifetime</p>
  
  <pre><code>result = a_pos + a_direction * lifetime * mix(a_speed, a_speed_end, normalized_lifetime);
  result.w = 1.0;
  gl_Position = u_projection * u_model_view * result;
  </code></pre>
  
  <p>This doesn't work as I'd hoped it would because it doesn't consider previous movements, so when normalized_lifetime reaches 1, the particle is basically set to a_pos again since a_speed_end is 0. How do I go about this?</p>
  
  <p>EDIT: More information:</p>
  
  <p>a_pos = startposition</p>
  
  <p>a_direction = normalized direction vector</p>
  
  <p>lifetime = current lifetime of the particle</p>
  
  <p>a_speed, a_speed_end = desired start/end speed</p>
  
  <p>They should move on a straight line along the direction vector, no CPU updates</p>