I have a VBO in draw() runs at about 29 fps, the vertex number (vhVertexCount) is about 6,300,000. I can draw a regular ofImage before the VBO with the same frame rate. However, as soon as I draw the ofImage directly after this chunk code, the frame rate drops down to less than 1fps:
//if I put this ofImage before VBO, it would not affect the performance significantly
// map.draw(10,10,250,250);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_2D);
moonTextureFBO.bind();
glBindBufferARB(GL_ARRAY_BUFFER_ARB, vhVBOTexCoords);
glTexCoordPointer(2, GL_FLOAT, 0, (char *) NULL);
glEnableClientState(GL_VERTEX_ARRAY);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, vhVBOVertices);
glVertexPointer(3, GL_FLOAT, 0,(char *) NULL);
glDrawArrays(GL_TRIANGLES , 0, vhVertexCount );
glDisableClientState(GL_VERTEX_ARRAY);
glDisable(GL_TEXTURE_2D);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
moonTextureFBO.unbind();
map.draw(10,10,250,250); // But this drops the frame rate after VBO
I think I unbinded the buffer and disabled everything I enabled. Why image draw after VBO will slow things down so terribly? What I am missing?