title: What is the difference between glVertexAttribDivisor and glVertexBindingDivisor?
body: <p>I was looking for ways to associate attributes with arbitrary groupings of verticies, at first instancing appeared to be the only way for me to accomplish this, but then I stumbled up <a href="https://stackoverflow.com/questions/14169228/opengl-single-vertex-attribute-for-multiple-vertices">this question</a> and <a href="https://stackoverflow.com/a/14171762/2036035">this answer</a> states :</p>
  
  <blockquote>
    <p>However what is possible with newer versions of OpenGL is setting the rate at which a certain vertex attribute's buffer offset advances. Effectively this means that the data for a given vertex array gets <strong>duplicated to n vertices</strong> before the buffer offset for a attribute advances. The function to set this divisor is <strong>glVertexBindingDivisor</strong>.</p>
  </blockquote>
  
  <p>(emphasis mine)</p>
  
  <p>Which to me seems as if the answer is claiming I can divide on the number of vertices instead of the number of instances.  However, when I look at <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glVertexBindingDivisor.xhtml" rel="noreferrer"><code>glVertexBindingDivisor</code></a>'s documentation and compare it to <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glVertexAttribDivisor.xhtml" rel="noreferrer"><code>glVertexAttribDivisor</code></a>'s they both appear to refer to the division taking place over <em>instances</em> and not <em>vertices</em>. For example in <code>glVertexBindingDivisor</code>'s documentation it states:</p>
  
  <blockquote>
    <p>glVertexBindingDivisor and glVertexArrayBindingDivisor modify the rate at which generic vertex attributes advance when rendering multiple <strong>instances</strong> of primitives in a single draw command. If divisor is zero, the attributes using the buffer bound to bindingindex advance once per vertex. If divisor is non-zero, the attributes advance once per divisor <strong>instances</strong> of the set(s) of vertices being rendered. An attribute is referred to as <strong>instanced</strong> if the corresponding divisor value is non-zero.</p>
  </blockquote>
  
  <p>(emphasis mine)</p>
  
  <p>So what is the actual difference between these two functions? </p>