From your question, I assume that you have huge middleware and I only have access to the shaders, am I right?
In this case, create a changing call in your vertex shader, for example, vertexID:
varying float vertexID; # in GLSL <= 3, or
out float vertexID; # in GLSL 4
and assign it the built-in gl_VertexID:
vertexID = (float)gl_VertexID;
, gl_VertexID , ! , , , 2 , 3 2,5 .
, , vertexID 2 ( 3): , . .
in float vertexID; # or
varying float vertexID;
if (fract(vertexID) < 0.1){
outcolor = vec4(1,0,0,0); # in glsl 4
}
, 2 . , , ( ID 2, 1000, 0,1 ).