
Originally Posted by
thokra
First of all, let me correct my previous statement: [0, elements * sizeof(type) - 1] is not the range the indices will be in. Of course, it's simply [0, 1, ..., elements - 1]. It is true, however, that bufferSize = elements * sizeof(type) and that the real offset into the buffer is calculated by sizeof(type) * index.
Regarding your current issue: Why don't you simply fetch the color at the vertices where the indices are unique and uninterpolated? Simply move your fetch to the vertex shader and have the GPU interpolate the colors not the indices. I'm actually not sure at the moment how int values are interpolated but obviously they are not what you want afterwards.