如何使用 glReadPixels 从前端缓冲区读取?
我在 Android 中使用 OpenGL ES 来渲染某些图像。一旦我渲染了框架,我就想复制它。虽然我可以使用 FBO,但只有某些设备支持 FBO。对于其他设备,我将不得不使用 glReadPixels ,这会消耗更多时间。由于 glReadPixels 只能复制后台缓冲区中的数据,因此只有在复制后才能交换缓冲区,这会影响渲染的响应时间。
有没有办法从 frontbuffer 复制数据。这样我就可以在处理结束后立即将图像渲染到屏幕上,并稍后从前台缓冲区获取副本。
编辑:在某些设备中,一旦缓冲区与前缓冲区交换,后缓冲区就会被清除。在某些其他设备中,它不会被清除。我希望图像保持在后缓冲区中,即使在将其交换到前缓冲区(而不是将其复制到前缓冲区)之后也是如此。有没有办法强制 gl 即使在交换后也不会清除后备缓冲区?
I am using OpenGL ES in Android to render certain images. As soon as i render the frame, I want to take a copy of it. Although I can use FBO for that, only certain devices support FBO. For other devices, I will have to use glReadPixels which consumes more time. Since glReadPixels can copy only the data from back buffer, the buffer can be swapped only after taking a copy which affects the response time for rendering.
Is there any way to copy data from frontbuffer. So that i can render the images to screen as soon as processing is over and take the copy later from front buffer.
EDIT: In some devices the back buffer gets cleared as soon as the buffer is swapped with the front buffer. In some other devices, it is not cleared. I would prefer the image to stay as it is in the backbuffer even after swapping it to front buffer ( rather copying it to front buffer). Is there any way to force the gl not to clear the backbuffer even after swapping?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用将读数切换到前端缓冲区Switch the reading to the front buffer using