Another update:

Well, I kind of found a solution, but it's really ugly.
If I remove the slave camera from the viewer, then set the new graphics 
context, and then add the slave cam to the viewer again, it works with a new 
resolution for each screenshot.
This seems very un-elegant though, and I'm pretty sure that this is a misuse of 
OSG in comparison to what was intended.

Jesper D. Thomsen


________________________________
From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jesper D. Thomsen 
[...@anybodytech.com]
Sent: Wednesday, May 27, 2009 2:42 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Using a slave camera to take screenshots in a 
different resolution than the main camera.

I just tried changing the main camere to a slave camera (as supposedly a 
main+slave cam combination is bad somehow). This changed the behaviour such 
that the screenshot slave camere can now take screenshots in any resolution for 
the first screenshot, but subsequent screenshots have the same rendered area as 
the first screenshot, which either results in black area (when the second 
screenshot has higher resolution) or a cropped screenshot (when the new 
screenshot is in lower resolution). I'm assigning a fresh graphics context to 
the slave camera before each screenshot, but it seems to ignore the resolution 
in the subsequent graphics contexts.
I'm pretty sure it's something really simple I'm forgetting to do.

Regards,

Jesper D. Thomsen


________________________________
From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jesper D. Thomsen 
[...@anybodytech.com]
Sent: Wednesday, May 27, 2009 1:18 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Using a slave camera to take screenshots in a different 
resolution than the main camera.

Hi all, I'm trying to use a slave camera to take screenshots in a different 
resolution than the main camera. I have tried setting the slave cameras 
renderingimplementation to Frame_buffer_object and pixel_buffer_rtt and have 
made a graphics context with the desired resolution, but I'm always just 
getting a screenshot where I have the desired content in the original camera's 
resolution in the lower left corner and black pixels in the rest of the 
screenshots area. I've tried changing the background color of the slave cameras 
graphics context, and this works fine with only the screenshot being affected 
and the windows rendered by the main camera looking as normal, so I'm guessing 
that it's using the FBO for the slave camera. I'm guessing that I have 
forgotten some kind of statement regarding the slave camera's graphics context.

regards, and thanks in advance.

Jesper D. Thomsen

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to