I had a few problems with it in the past, and having read quite a few posts about it, I guess I am not alone. Still I thought my solution worked well.
I render to an FBO in HD resolution (1920*1080, 25 FPS). I did not use the PBO route to read back the final buffer holding my rendered frames because I thought the CPU is the one that has to wait for the end result and I would not gain anything by making the read back process async with a PBO. This resolution means reading back 200MB/sec which the PCIe bus is well capable of.
But when the render becomes complicated (lots of polygons, shadows,reflections, etc.) play back starts to stutter, and according to Task manager, the CPU core handling the opengl thread is close to 100%. If I do nothing else but comment out the glReadPixels line, that near 100% load goes back to 2-3%, and play back on VGA looks perfect (which also means that my GPU still did not reach its limits).
I simply cannot explain this. I switched to using two PBOs to make the read back async, and although now CPU load does not climb over 10-11%, play back still stutters sometimes. If I just comment out the glReadPixels with the NULL at the end that AFAIK only involves DMA to fill the PBO, playback becomes perfectly smooth but of course I don’t get anything in my system RAM buffer that holds the data read back.
Can someone explain why this happens and why only when the render becomes complicated? What that has got to do with filling in a buffer using - in theory - only DMA?