High Poly Object rendered very slow

But know my picking doesn’t work anymore. I’m using color picking and so I have to render every triangle in a unique color.

Then you need to have an array of colors that matches the array of positions, such that each triangle gets a separate color when rendered. Then, turn of interpolation, so that each triangle only uses that color. This array would only be used for picking.

That would oppose his efforts to remove duplicate vertices and makes it really awkward to create an index/vertex arrangement which makes sure that the provoking vertex of each triangle is not shared by other triangles.

Maybe using gl_PrimitiveId() in the fragment shader would already help him?!

Even with flat shading when you use indexing that shares vertices triangles will share an invoking vertex and therefore color.

You could have two draw modes, one for rendering and one for picking.

The other way is to know the complete set of triangles invoked by a colored vertex so that when you get a pick result you can then narrow it down to a very few triangles and you draw those triangles only (with unique colors) to complete your pick.

Don’t know if this has been mentioned but you can optimize your index buffer for the post transform cache using this library. I’ve also read that you can restrict your vertex buffer size and split it up to work best on certain hardware.