How can I create a PBO (Pixel Buffer Object) and bind it as a GL_PIXEL_PACK_BUFFER
do glReadPixels
and read the data back at a later point of time from the PBO using something like glGetBufferSubData
in LibGDX?
Asked
Active
Viewed 303 times
1 Answers
4
Unfortunately I am not allowed to comment. I hope the following information is what you need, judging from another SO question that you asked earlier:
There is a tutorial which demonstrates an example where 2 PBOs are used to "asynchronously" read & process data from the framebuffer in each render frame:
the 2 PBOs are used alternatively:
- one for reading data of the current frame from the framebuffer to the PBO
- one for transferring/processing the data of the last frame from the PBO to the CPU
You can just translate the GL calls from the tutorial to the corresponding GL calls in libgdx.
-
As you may have seen in my other post: I have fixed my problem. So this question is kinda answered too. Back to your answer one problem with `GL30` is that it is relatively new. I think Android 4.2 oder something like that is required. – Niklas Sep 10 '14 at 21:22
-
Yes, you are correct, for PBOs you need OpenGL ES 3.0 or newer. I wonder what's actually faster :) (disregarding your requirements for compatibility) – mucaho Sep 10 '14 at 21:37