I have many objects in my scene and I want to colour every object with different colours. Now, my fragment shader consists of :
void main (void)\
{\
gl_FragColor = vec4(0.82, 0.41, 0.12 ,1.0);\
}";
and the vertex shader consists of :
attribute highp vec4 myVertex;\
uniform mediump mat4 myPMVMatrix;\
void main(void)\
{\
gl_Position = myPMVMatrix * myVertex;\
}";
and hence it colours each object with the same colour. Can anyone tell how can I colour differently ? I have prepared a 2D array consisting of the colours for all the objects. I can't figure out how to pass them to the fragment shader or how to change the fragment shader and vertex shader code ?