OpenGl to image

Hey

I’m wondering what the best way to convert OpenGl to an image is, i see alot of people use glReadPixels to do this. Is this the quickest way because I want to try streaming images over a network and viewing an opengl app on another machine on the network. Would glReadPixels be the best way to do this?

I don’t even need the opengl app to be shown on the running machine, I just want to view the video on the other machine. I will also be adding controls in so i can control the opengl app from the networked machine so I want the video streaming to be as fast as possible (from opengl to image).

Thank you…

P.S. if this is the wrong forum for this feel free to point me elsewhere.

Yes glReadPixels is the best way.

To get the image across the network you should probably compress it first. Keep the compression simple and fast.

Color cell compression has been used for similar purposes, but RLE might be appropriate or some scanline based dictionary after arithmetic manipulation.

Its been a while but have read/write pixels been improved? They are fundamental parts of gl but in the older days were ignored, or so it seeemed. In terms of speed. We used to make our own block read/write routines

It was mostly a matter of “added value” in pro cards, like wireframe and quad buffered stereo, all artificially hidden from consumer eyes … ok I had a bad day.

Actually, I’ve found glReadPixels can be fairly quick when used properly (10 ms for 1024x768 PCI express). If you read from an RGBA8 framebuffer, make sure you use the GL_BGRA format to read to. If you read from a FLOAT32_RGBA framebuffer, then read to format GL_RGBA for best performance. Also, this is highly hardware/driver dependent, so you’ll want to be careful. However, I think this rule applies to both NVidia and ATI cards.

Kevin B

Awsome, 10 ms for 1024x768 PCI express sounds really good. Thanks everyone, I’ll give it a go. Going to try it now.