Tim Stirling
09-02-2001, 12:30 AM
I have messed around with vertex arrays before and now it is time I implement CVAs in my mini engine to get some kind of performance out of it. 700K tris/s isn't much and I know I am geometry limited at times.
One thing I thought I liked about Vertex arrays is that you could share vertices- store the 8 vertices of a cube instead of 36 for each triangle or 24 if using tri-stips/ quads per a face. This could lead to a large performance increase! However Just because some polygons vertices are in the same place as anothers doesn't mean that they will have the same texture coordinates and so you basicly end up having to store each coordinate of each polygon inside the vertex array instead of just each unique vertex. Using glArrayElement you can specify seperate tex-coords but it is slow anyway. To use glDrawElements you would not be sharing any vertices so it is hard to see where much of a performance gain can come from.
Ex. a simple landscape engine with a 257* 257 heightmap giving 256*256*2 triangles * 3 vertices ~= 400K verts to transform compared to 66K if vertices were all shared. You would have to use the first case since each vertex would/could have a different texture coordinate or colour.
Am I being stupid or am I correct in thinking that you can't practicly share vertices.
Tim
One thing I thought I liked about Vertex arrays is that you could share vertices- store the 8 vertices of a cube instead of 36 for each triangle or 24 if using tri-stips/ quads per a face. This could lead to a large performance increase! However Just because some polygons vertices are in the same place as anothers doesn't mean that they will have the same texture coordinates and so you basicly end up having to store each coordinate of each polygon inside the vertex array instead of just each unique vertex. Using glArrayElement you can specify seperate tex-coords but it is slow anyway. To use glDrawElements you would not be sharing any vertices so it is hard to see where much of a performance gain can come from.
Ex. a simple landscape engine with a 257* 257 heightmap giving 256*256*2 triangles * 3 vertices ~= 400K verts to transform compared to 66K if vertices were all shared. You would have to use the first case since each vertex would/could have a different texture coordinate or colour.
Am I being stupid or am I correct in thinking that you can't practicly share vertices.
Tim