I have some data that I do not have control of (provided by the client) which specifies:
vertices
indices
a "colorPalette" (8 different colours of vec4, 32 values in total)
a "vertexColors" array that defines which vertices should have which colour from the colorPalette applied to them. e.g. 0,0,1280 in this array means, "colour '0' from colorPalette should be applied to all vertices with an index between 0 and 1280."
It seems to me that when I define my GLSL Vertex Shader, I need to be able to access the index of the current vertex so that I can determine, using vertexColors, which colour, from colorPalette, to apply and pass through to the Fragment Shader by use of a varying.
How do I find the index of the current vertex?
Thanks for any help,
Phil.
P.S. I am very new to Open GLES 2.0, have never used OpenGL or OpenGLES before and am taking all my guidance from "OpenGLES 2.0 Programming Guide" and anything I can find on the internet.
P.P.S. Seems to me that Open GLES 1.x looked a lot easier :)