I am working on a simple CAD graphics engine currently limited to Opengl 1.1 functionality. The documents consist of 1000’s of tiny arcs or lines. To optimize rendering I batch the lines and arcs together and render then using
glVertexPointer
glLockArrays
glDrawRangeElements
glUnlockArrays
This yields really good performance if I try to maximize the size of the arrays to a value the graphics card can handle. Rendering each line with individual calls to Opengl is too slow.
I am also performing the same algorithm for surfaces. The problem I face with both methods is that the color of all geometry currently has to be the same. To change the color (say for selectio) I have to move all the geometry for a given object (a line, a surface) into a different buffer.
This operation becomes costly depending on what is selected and how. Does anybody know a way I can render geometry in an array and render parts of it using different materials/colors? Solutions do not have to be limited to Opengl 1.1