OpenGL ES2.0 glReadPixels() is very slow

1.4k views Asked by At

I am using glReadPixels to read the pixels from FBO to memory.

Here is the code:

UINT8* data;
glBindFramebuffer(GL_FRAMEBUFFER, FBOID);
glReadPixels(0, 0, w, h, GL_RGB, GL_UNSIGNED_BYTE, data);

I found this operation is very very slow... Is there any alternative in openGL ES2.0(Android)?

1

There are 1 answers

0
Arttu Peltonen On BEST ANSWER

Yes, it's quite slow. OpenGL ES 2.0 doesn't provide a faster way on Android. You could use PBOs on OpenGL ES 3.0 but that may not be an option for you, since very few devices support that at the moment and it requires Android 4.3.

EDIT: I do know that some devices have serious performance issues uploading RGB textures, maybe it happens in the opposite direction too. Try using RGBA format instead.