I've been having trouble with the gl_VertexID built in vertex index, passed using in, to work with Three.js
I'm not sure why, as the documentation says it works in all versions of OpenGL
http://www.opengl.org/sdk/docs/manglsl/xhtml/gl_VertexID.xml
I'm using this vertex shader:
uniform int freqData[64];
uniform int fftSize;
in int gl_VertexID;
void main() {
vec3 norm = normalize(position);
int modFFT = mod(gl_VertexID, fftSize);
vec3 newPosition = norm * float(freqData[modFFT]);
gl_Position = projectionMatrix * modelViewMatrix * vec4( newPosition, 1.0 );
}
The error I receive is:
ERROR: 0:68: 'in' : syntax error
It seems to have a problem with the in declaration, and it doesn't complain about anything else (the error console is able to detect multiple compilation errors).
I very much appreciate your help, I'm working with yesterday's Three.js build.