Vertex optimizing

Hi people!
I have a big doubt, if I send via OpenGL two vertexs with the same coordinates to the GPU, this one is able to know that the second vertex is the same as the first one and dont paint it or it paints the two vertexs anyway?

Thanks in advance!
F.

First vertex will be overwritten by second (GL_LEQUAL) if you won’t change each vertex coordinates in vp.
Primitive->matrix transforms(ff pipe or vp)->raster for every vertex.

That isn’t entirely correct, but rather applies to depth buffered primitives.
A single vertex never renders anything (well, not exactly never, GL_POINTS is the exception …).

If you render triangles (as I believe you do), the vertices are subject to the primitive assembly stage. A triangles will be formed from three vertices, in the order the vertices are specified. If the first three vertices form a degenerate triangle, that is what you get. OpenGL doesn’t wait for a fourth vertex to resolve a degenerate. The fourth one will already be part of the next triangle.

>>dont paint it or it paints the two
>>vertexs anyway?
yes, it’s going to be painted; but i think that it won’t be transformed a second time in the rendering pipeline because of the cache. but i’m not sure, some of the “hardware intrinsic freaks” around here should answer this 100% clear.

It depends on how you specify the vertex. If you do a plain ol’ glVertex* or use vertex arrays then OpenGL has no idea that it’s the same vertex coordinate, so both verticies will march does the same path in the pipeline.

If you use an indexed vertex array and you send the same vertex twice by the same index, then OpenGL knows that the coordinate is being shared. For the most part, that vertex is processed only once.

In the case of a display list…who knows. It is plausible that the display list compiler scans the geometry you specify and tries to make it into an indexed vertex array, but there are certainly no guarantees.

-Won