Texture coordinates are not updating according to the vertex divisor specified I want to draw a string of text with a single draw call (Instancing). I am reading a bitmap for each character texture. I want to pass the texture coordinates for each vertex of a quad (a single character). Now these texture coordinates are supposed to be updated for each vertex processed by the vertex shader because I set the glVertexAttribDivisor() to 0 which means it should be. But it's not happening.

Here's the source code where I am sending the data to the GPU...

//TEXTURE COORDS
glBindBuffer(GL_ARRAY_BUFFER, mVBOTexCoords);
glBufferData(GL_ARRAY_BUFFER, sizeof(glm::vec2)*mTexCoords.size(), mTexCoords.data(), GL_STATIC_DRAW);

glEnableVertexAttribArray(3);
glVertexAttribPointer(3, 2, GL_FLOAT, GL_FALSE, 0, 0);

glVertexAttribDivisor(3,0);


and the vertex shader...

#version 400 

out vec2 tex_coords;

layout(location = 0) in vec2 pos;
layout(location = 1) in vec2 offset;
layout(location = 2) in vec2 scale;
layout(location = 3) in vec2 tex;

uniform mat4 projection;

void main()
{
    tex_coords = tex;

 vec4 position = vec4(pos,0.0f,1.0f);
     position.xy*=scale;
     position.xy+=offset;

     gl_Position = projection*position;

}


Sorry for the mess. I hope you get it. I am not getting why its not updating the texture coordninates for each vertex.
Now this texture coordinates supposed to be updated for each vertex processed by vertex shader because i set the glVertexAttribDivisor() to 0 which means it should be.


No, it doesn't.

A divisor of 0 means that the texture coordinate work exactly as if you hadn't called glVertexAttribDivisor for that attribute at all. 0 is not a special case; it's the default.

That means that the texture coordinate will be updated at the same rate as the position. So it will get the same value for each instance, exactly like it does for the positions.

There is no way to use instancing to get an attribute to always increase. It either is a per-instance attribute (changing more-or-less based on gl_InstanceID) or it is a per-vertex attribute (changing based on gl_VertexID). To get the per-instance behavior, you use a divisor 1 or greater. To get the per-vertex behavior, you use a divisor of 0.