update vertex attribute once per primitive?
hi all. is their a way to have one vertex attribute being updated per a specified number of primitives?
Not directly. With instanced rendering, you can have an attribute updated once per a specified number of instances by using glVertexAttribDivisor() or glVertexBindingDivisor(). Or you can store the attribute data in a texture (or uniform array, buffer array, etc) and use gl_VertexID to calculate an index into the array.
Originally Posted by sandbucket