I want to write a shader program which will render each triangle of the mesh in distinct color (so I could pick one triangle). I tried to use gl_PrimitiveID, but it always returns 0, for example:
#version 330
out uvec3 FragColor;
void main()
{
FragColor = uvec3(0.0, 0.0, gl_PrimitiveID);
}
This shader always renders black color.