This section describes how to draw geometry with optimal primitives. Consider these guidelines to optimize drawing:
Connected primitives are desirable because they reduce the amount of data both stored and transferred, and the amount of per-polygon or per-line work done by the OpenGL. Be sure to put as many vertices as possible in a glBegin()/ glEnd() sequence to amortize the cost of a glBegin() and glEnd().
When rendering independent triangles, use glBeginGL_ TRIANGLES(GL_ TRIANGLES) instead of glBeginGL_ POLYGON(GL_ POLYGON). Also, when rendering independent quadrilaterals, use glBeginGL_ QUADS(GL_ QUADS).
Use a single call to glBeginGL_ TRIANGLES(GL_ TRIANGLES) to draw multiple independent triangles rather than calling glBeginGL_ TRIANGLES(GL_ TRIANGLES) multiple times. Also, use a single call to glBeginGL_ QUADS(GL_ QUADS) to draw multiple independent quadrilaterals, and a single call to glBeginGL_ LINES(GL_ LINES) to draw multiple independent line segments.
Concave and self-intersecting polygons must be tessellated by the GLU library before they can be drawn, and are therefore prohibitively expensive. Nonplanar polygons and polygons with large numbers of vertices are more likely to exhibit shading artifacts.
If your database has polygons that are not well-behaved, perform an initial one-time pass over the database to transform the troublemakers into well- behaved polygons and use the new database for rendering. You can store the results in OpenGL display lists. Using connected primitives results in additional gains.
Polygon rates can be affected directly by the number of normals or colors sent per polygon. Setting a color or normal per vertex, regardless of the glShadeModel() used, may be slower than setting only a color per polygon, because of the time spent sending the extra data and resetting the current color. The number of normals and colors per polygon also directly affects the size of a display list containing the object.
Try to send the same type of data for each vertex of a primitive. In other words, if the first vertex has an associated color or normal, the primitive can often be more efficiently processed if all the following vertices also have a color or normal.