Hi J-S, On Wed, Jun 4, 2008 at 4:10 PM, Jean-Sébastien Guay <[EMAIL PROTECTED]> wrote: > Again about new examples. :-) I saw the osgscreencapture example that was > recently added.
Observant once more :-) osgscreencapture example was written to test out use of double buffer PBO's for readback of high res imagery at real-time for the purpose of video processing/output. It thankfully showed that it's possible to 60Hz readback of 1920x1050 :-) It doesn't yet record single screenshots, or have an API that is refined enough to go into osgViewer, but there is potential for this. For screenshots there is no any need for using PBO though, it only becomes useful once you double bufffer and do readback on subsequent frames, PBO readback on the same frame is slower than using glReadPixels directly. PBO readback is also very very sensitive to frame buffer format - basically you need a RGBA colour buffer, RGB color buffers have stalled the fifo in the testing that we've carried out on Linux, XP and Vista. > Would you like me to use the WindowCaptureCallback from that example as a > starting point for the screenshot handler I was planning to write for > integration into the stock osgViewer event handlers? The code in the example is not bad place to start. > I plan on having the handler have keys to enable capture of the next frame, > as well as capture of all frames until another key is pressed to stop (to a > sequence of numbered images). Any other ideas for what should be possible? For sequence of frames it might be best to provide a callback interface for when the data is ready, this way the user could implement their own backend. One could possible provide a write to image file as one available implementation. I'd also keep the camera callback capture side decoupled from the event handling and callback assignment. > I notice the callback slows down the viewer significantly (it runs at 30fps > here) even when saving the images is commented out. Any ideas on how to > speed it up? (I can look into it if you don't have time or if it's not part > of your priorities) Try adding --rgba to the options in osgscreencapture to force an RGBA colour buffer. Also try osgscreencapture cow.osg --pbuffer-only 1280 1024 For some off screen capture fun. Robert. > I plan on starting to work on this soon (possibly today). Feedback would be > appreciated so that I don't go in a bad direction. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

