Vertex Buffer Object for indices?

Started by
1 comment, last by V-man 14 years, 2 months ago
Hi Guys, Just a quick (and probably silly) question. I am setting up to use VBO's in my OpenGL rendering implementation. I will essentially end up with VBO's in the 2-12 MB range containing raw vertex information (no colors, normals, etc, just the geometry) representing triangle lists. For a few reasons I wont be able to pre-process this data to combine shared vertices, etc. My question is, given that I would be basically creating a unique index for each vertex in the buffer anyway, is there any advantage to creating the index VBO at all? Is the card going to perform some magic to make this step worthwhile given that it would be using a butt-load of valuable memory for these index VBO's? My default thinking is that I should just bind my vertex VBO and use glDrawArray() without all the other kludge, but if there are performance gains to be had then I will do the index VBO as well. Cheers!
Advertisement
Why can't you build a proper vertex + index buffer to combine dupes?

If every vertex is truly unique, there's likely no good reason to create an index buffer

But you should.
Forget the index buffer.glDrawArray()exists for a reason.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement