Originally posted by daveg:
You should be able to reuse the vertices by using Vertex Arrays and using the glDrawElements call, which takes an index list. Using this technique you should only need to specify your vertex once in the vertex array but access it as many times as required via the index array. This should prevent any unwanted transforms.
Sorry, but every time I specify vertex index using glDrawElements call this vertex is transformed and lit once again. If OpenGL was to calculate vertex in vertex array only once, it would have to:
a) remember transformed and lit vertex parameters in some structures (OpenGL 1.1 spec says nothing about that)
b) keep track of all rendering context modifications and discard already transformed / lit vertices if it changes (If I change matrices or light parameters previously transformed/lit vertices are invalid).
As for my best knowledge OpenGL does not do that. At least with Voodoo 3 and GeForce using latest drivers - drawing plane using triangles is almost exactly 3 times slower than using triangle strips (when window size is very small and rasterization does not take too much time). This means that every vertex is calculated SIX times (triangles) instead of TWO times (triangle strips). But I want it to be calculated ONCE.
In DirectX (starting with version 7.0) there is a function called ProcessVertices() that calculates all given vertices once and then you can draw as much primitives as you want without any more transforms. Is there any OpenGL extension that allows for the same?