Hi Harald, I you want to change the background colour for a screenshot I'd be inclined to use a pbuffer and totally separate Camera for the task and just switch it on using a NodeMask, this way the main window won't be affected by playing games withe background colour.
Robert. On Wed, Dec 9, 2009 at 8:40 AM, Harold Comere <[email protected]> wrote: > Hi all, > > For screenshot and printing purpose, i am trying to change the background > color before the render pass and screenshot writing. > > When i want to take a screenshot, i try to change the clear color with > camera->setClearColor(xxx) and set a flag at true to activate the screenshot > as camera final draw processing. > This change is done before osg::Viewer::frame() call so the glClearColor > call should be done after the setClearColor call. But the clear color change > is taken into account the next frame, so my screenshot is taken with the > wrong background color. > > If i am not wrong, the call order is > > - camera->setClearColor( anyColor ) > - event handlers > - node callbacks > - pre camera draw callback > - rendering > - post camera draw callback ( screenshot taken here ) > - camera->setClearColor( initial color ) > > For some reasons i do not want to have to wait a new frame to take my > screenshot, so i am wondering if there is a way to force the background > color change instantly ? > > Thank you for your attention, > > Regards, > Harold > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

