本文介绍了的OpenGL ES2.0 glReadPixels()是很慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我使用glReadPixels读取FBO像素内存。

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

下面是code:

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

我发现这个操作非常非常缓慢...有没有在OpenGL ES2.0(Android版)?

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

推荐答案

是的,这是相当缓慢的。 OpenGL ES 2.0的没有提供在Android更快的方法。你可以上的OpenGL ES 3.0中使用公益组织,但可能不是你的一个选择,因为很少有设备支持的时刻,它需要Android 4.3的。

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.

编辑:我知道有些设备有严重的性能问题的上传的RGB纹理,也许它在相反的方向发生了。尝试使用RGBA格式来代替。

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.

这篇关于的OpenGL ES2.0 glReadPixels()是很慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 07:52