PDA

View Full Version : OpenGl to image



BabyG
06-07-2006, 03:00 AM
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.

dorbie
06-07-2006, 03:34 AM
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.

Gavin
06-07-2006, 07:09 PM
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

ZbuffeR
06-08-2006, 11:05 AM
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.

ebray99
06-08-2006, 01:15 PM
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

BabyG
06-09-2006, 11:42 PM
Awsome, 10 ms for 1024x768 PCI express sounds really good. Thanks everyone, I'll give it a go. Going to try it now.