Hi Kenzo, I wouldn't implement this type of management by reassigning a single osg::Camera with different setting but use a different Camera. I would also leave alone the master Camera and instead prefer to add/remove slave Cameras.
My guess to why you haven't been able to do what you want is the rendering backend data structure that is assigned to the osg::Camera to manage the the data accumulated during the cull traversal and which is that traversed in the draw traversal. The osg::Camera methods relating to this data structure is: /** Set the Rendering cache that is used for cached objects associated with rendering of subgraphs.*/ void setRenderingCache(osg::Object* rc) { _renderingCache = rc; } /** Get the Rendering cache that is used for cached objects associated with rendering of subgraphs.*/ osg::Object* getRenderingCache() { return _renderingCache.get(); } Perhaps resetting this RenderCache to 0 would do the trick. Robert. On 10 October 2012 22:12, Kenzo Lespagnol <kenzo.lespag...@cm-labs.com> wrote: > Hi, > > I'm trying to disable a render-to-texture by removing the slave cameras, used > for the RTT, and by restoring the main camera. But it seems I'm not able to > restore my main camera to render into the frame buffer again. > > I set the main camera to render to texture by following: > > Code: > mOrginalRenderTargetImpl = mInputCamera->getRenderTargetImplementation(); > mInputCamera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT, > osg::Camera::PIXEL_BUFFER_RTT); > mInputCamera->attach(mAttachedBufferComponent, mSceneTexture.get(), 0, 0, > false, antialiasing, antialiasing); > > > > And I'm restoring by this: > > Code: > mInputCamera->setRenderTargetImplementation(mOrginalRenderTargetImpl); > mInputCamera->detach(mAttachedBufferComponent); > > > > Is something I missed? > > Thanks. > Kenzo > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=50555#50555 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org