gl3: texelFetch in Vertex shader with vertex index
Hello,
I would like to assign for each vertex a different value v in a calculation in a vertex shader.
The values are stored in a jit.gl.buffer which is connected to a jit.gl.mesh and the buffer is bound in a jit.gl.shader to the vertex program.
So I would like to do something like this here, but I can't figure out if this the correct way to pass the vertex indices for texelFetch():
uniform samplerBuffer buffer
in int gl_VertexID;
void main () {
vec3 v = vec3(texelFetch(buffer, gl_VertexID).xyz);
...
}
that *should* work, what results are you getting?