Hello there!
I’m a newbie at OpenGL (but an oldbie when it comes to programming) so I need a little help.
I want to capture the screen for use in a VNC like app. I’m a performance freak so the highest possible performance is what I aim for (I get 20 or 30ms to capture 1920x1200 with a simple glReadPixels, but I need more). I have read all post in this forum that contains Capture, though I still need a bit more information.
I need to capture, flip-y and scale the capture. The flip is because the next step needs 0, 0 to be top left and the scale is because, i guess, it is fast to do when the pixels are still in VRAM.
Is this the fastest route:
Init:
- create a 2 x texture (is pow 2 still faster? It wastes a lot of VRAM…)
Every frame:
- Copy the front buffer to texture#1 using glCopyTexSubImage2D().
- Set some kind of transform that scales and flips the image and copy the texture to texture#2 (or a PBO?)
- glReadPixels to DRAM. (or is it faster to map and memcopy it?)
Anything else?
I know I can performance test the cases but there’s a lot of different hw out there, as well as driver versions and no matter how much I read I can’t beat the experience of real world use you guys have… (For instance, it seems that nVidia is much faster when it comes to VRAM-DRAM than ATI).
Any pointers, comments or suggestions are much appreciated. Code even more so, if you have it.
Btw, a short q, can memory be copied VRAM->DRAM using DMA or is that just VRAM->VRAM? DMA is good since it free up the CPU for other stuff. It won’t reduce the latency but it will improve the throughput (both of which are important in a VNC app).
Cheers,
Mikael Grev