[osg-users] Large Screen Capture - render to texture?

russelmg at gdls.com russelmg at gdls.com
Thu Sep 6 10:03:40 PDT 2007

I need to get a large screen shot (preferably 2352x1796) of my scene.   I 
followed the basic screengrab code:
osg::ref_ptr<osg::Image> image = new osg::Image;
image->readPixels(x,y,width,height, GL_RGB,GL_UNSIGNED_BYTE);

But it didn't work like I wanted it to.  By passing in 2353 and 1796 for 
my width and height, the app would create an image of that size, but it 
would only capture 1280x1024 (my screen resolution) of the actual scene 
and the rest of the image was black.

I think the right way to do this is to capture to texture.   I looked at 
the osgprerender.cpp example but am not clear on how to modify it to do 
what I'd like and how to capture the texture to a file.

Also, if I do capture this texture to a file, is there a way to apply this 
texture to a quad?
regards -

Mark Russell
Modeling & Sim Software Engineer
(586) 825-4783
russelmg at gdls.com

This is an e-mail from General Dynamics Land Systems. It is for the intended recipient only and may contain confidential and privileged information.  No one else may read, print, store, copy, forward or act in reliance on it or its attachments.  If you are not the intended recipient, please return this message to the sender and delete the message and any attachments from your computer. Your cooperation is appreciated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070906/e0fbb16d/attachment-0002.htm>

More information about the osg-users mailing list