VBO Question

Started by
10 comments, last by V-man 18 years, 6 months ago
Keep track of the vertex count and size the vertex buffer accordingly, instead of MAX_VERTS.
Advertisement
It's a good idea to use formats that are typically accelerated by GPUs.

For example :
3 floats per vertex
4 ubyte per color


Most importantly, don't call glBindBuffer when you don't have to. That will reduce performance on some cards.

Also, interlace your data. Make 1 VBO that contains the vertex and colors.

Do you really have static data, or is it dynamic?
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