this way PBO can be used for render-to-texture implementation:
glBindBuffer(GL_PIXEL_PACK_BUFFER_EXT, m_iBuffer);
glReadPixels(0,0, 512, 512, GL_RGB, GL_UNSIGNED_BYTE, NULL);
glBindBuffer(GL_PIXEL_PACK_BUFFER_EXT, 0);
glBindTexture(GL_TEXTURE_2D, m_iTexture);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_EXT, m_iBuffer);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 512, 512, GL_RGB, GL_UNSIGNED_BYTE, NULL);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
it works, but it is only 3% faster(GeForce2 GTS) than the following:
char buff[512][512][3];
glReadPixels(0,0, 512, 512, GL_RGB, GL_UNSIGNED_BYTE, buff);
glBindTexture(GL_TEXTURE_2D, m_iTexture);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 512, 512, GL_RGB, GL_UNSIGNED_BYTE, buff);
what's wrong? Why doesn't PBO accelerate the process of data transmission within the videocard? Well, maybe the PBO main intent is to parallelize data excange between app and gfx card, but in this case it should also increase performance, I think.