Hi all.
I am developing a benchmark to find if it’s better to use display lists or vbos for future private purposes.
The benchmark is quite simple, it consists in a window where a static model of about
4000 triangles is drawed multiple times.
First i stored my model data in a display list and then in my render i called that dl 1000
times per frame. I got a result of about 37 fps.
Then i tried to use Vbos to draw my model but i am quite new with vbos so i think i’ve just got
something wrong becouse drawing 1000 models on screen i go a result of 2 to 5 fps.
I just followed some tutorials to implements vbos and i used the following code in my vbo model draw method:
gl.glEnableClientState(GL.GL_VERTEX_ARRAY); // Enable Vertex Arrays
gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY); // Enable Texture Coord Arrays
gl.glBindBufferARB(GL.GL_ARRAY_BUFFER_ARB, VBOTexCoords[0]);
gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, 0); // Set The TexCoord Pointer To The TexCoord Buffer
gl.glBindBufferARB(GL.GL_ARRAY_BUFFER_ARB, VBOVertices[0]);
gl.glVertexPointer(3, GL.GL_FLOAT, 0, 0);
gl.glEnable(GL.GL_TEXTURE_2D);
gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, getTrianglesNumber()*3);
gl.glDisableClientState(GL.GL_VERTEX_ARRAY); // Disable Vertex Arrays
gl.glDisableClientState(GL.GL_TEXTURE_COORD_ARRAY);
Did i do something wrong or is it common that with many triangles my performances drop significantly using vbos?