I'm drawing set of polygons using glMultiDrawArray command. I want to color each polygon with a different color. If I can access the primitive index (or the polygon) a vertex belongs to inside vertex shader, I can look color up from an array and set the color.
So my question is: Is it possible to access primitive index within a (vertex) shader?
What are the other alternatives to color each polygon using a different color?