Assigning a face value

Hi guys,

I would like to have an identifier in every face to know wich one is into the fragment shader. I’ve tried to use gl_PrimitiveID but I get values like 10602496 or 11106432 and I only have 3968 faces.
I only use vertex and fragment shader. Should I use geometry shader to use gl_PrimitiveID? Which is the best way to assign a face value withou duplication of vertices?

Thx

I’ve solved the problem. It was in other part.
It’s not necessary to use a geometry shader to use gl_PrimitiveID. You only have to initialize the gl_PrimitiveID if you use a non-default geometry shader.