View Full Version : render to screen and file

05-16-2007, 01:23 PM
Hi there all you smart and experienced GL people.

I have something that aspires to be a kind of a simulator for microbiology purposes. I have been doing it for many months now, and I need some nice and smooth way to export what’s going on the screen to a series of images. I guess you know the idea, I run the thing, the application does some fancy calculations and displays animated 3d objects as the result. I want to be able to see what’s going on (and interact) and store a percent of all frames to files. I would be thankful for pointing me the direction how to bite this problem.

05-16-2007, 02:17 PM
You can store the rendered mage in a file by reading back the draw buffer (via glReadPixels) and storing it in a suitable format. maybe you should formulate your question more preciselly, I didn't really understand what do you want.

05-17-2007, 01:43 PM
OK, sorry for my messy text. The idea is to be able to render to screen and the same frame render to file. The purpose is to generate a sequence of images or a video afterwards. So glReadPixels (I used it once, years ago ;) ), but is there any alternative? Or this is the optimal solution?

05-17-2007, 01:51 PM
Well, it will be slow... But it is the easiest way. You could also use the PBO extension to speed up the readback, read this : http://http.download.nvidia.com/develope...e_Transfers.pdf (http://http.download.nvidia.com/developer/Papers/2005/Fast_Texture_Transfers/Fast_Texture_Transfers.pdf)

05-18-2007, 02:29 PM
Thanks for the tip.

05-18-2007, 10:29 PM
Why not use Fraps that saves videos out of any OpenGL program!?

I use it for creating my own videos out of my apps.

You don't have to program a single line, it just attaches to your program and you can save screenshots and videos.

You can find a free trial version on google.