PDA

View Full Version : What to use instead of glDrawPixels



PeterHer
01-13-2014, 05:38 AM
Hi All,

Currently I use glDrawPixels to display some live data from a camera.
I am aware that this is not the right way to do this because glDrawPixels is deprecated.

Any idea how to display a databuffer of 640 * 640 pixels @ 60Hz without using glDrawPixels?

The full capacity of the camera is 2560 * 2048 pixels @ 120 frames/sec.
Can Opengl handle such large block of data at once?

Thanks in advance.

Peter

Dark Photon
01-13-2014, 06:39 AM
Any idea how to display a databuffer of 640 * 640 pixels @ 60Hz without using glDrawPixels?

The full capacity of the camera is 2560 * 2048 pixels @ 120 frames/sec.
Can Opengl handle such large block of data at once?
I would check what format your camera is generating as output. I would suspect its compressed in some form (e.g. MPEG4-AVC, etc.) . If so, you want to be talking to your GPU in terms of APIs that support feeding in compressed video data for GPU-based decompression and playback. For instance, for GeForce 8+ GPUs, NVidia has VDPAU (http://www.mythtv.org/wiki/VDPAU) which works very well.

If it's not compressed, then that's a fair amount of bandwidth. Imagine 2560*2048 at 24-bit color. That's 15MB/frame * 120 fps = 1.8 GB/sec. Now that should easily fit down a PCIe x16 v2 interface (8 GB/s theoretical, prob more like 6.4 GB/sec in practice), if your GPU is fast enough to hack it. But you'll want to be careful how you subload the data to the card via PBOs to maximize performance. There's an article in Opengl Insights (http://openglinsights.com/) on this IIRC. In fact, looks like it's linked to that very web page.