Hey Mick, That looks useful thanks a lot!
To be honest, I was a bit surprised that textures could be resized by simply calling setTextureSize(…). I was wondering why one doesn’t have to reallocate them with the new size. Anyway, thanks :) Christian. On Mon, Feb 8, 2010 at 8:48 AM, Mick Keller <[email protected]> wrote: > Hi Art! > > > art wrote: >> >> I think we have to investigate the main osg code, since it seems that >> dynamic resizing of FBOs and its attached textures isn't well supported, but >> I am not sure. >> > > > I'm not sure if this addresses your problem exactly (I'm not very familiar > with osgPPU): > If I need to adapt my viewport and to resize my RTT-textures I use something > like this: > > > Code: > > _cam->setCullCallback( new fboAttachmentCullCB( this ) ); > > void fboAttachmentCullCB::operator()(osg::Node* node, osg::NodeVisitor* nv) > { > osg::Camera* fboCam = dynamic_cast<osg::Camera*>( node ); > osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(nv); > > if ( fboCam && cv) > { > cv->getCurrentRenderBin()->getStage()->setFrameBufferObject(NULL); // > reset frame buffer object - see RenderStage::runCameraSetUp for details, the > fbo has to be created again > cv->getCurrentRenderBin()->getStage()->setCameraRequiresSetUp( true ); > // we have to ensure that the runCameraSetUp will be entered! > } > traverse(node,nv); > } > > > > > > Best regards, > Mick[/code] > > ------------------------ > SVT Group > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=23792#23792 > > > > > > _______________________________________________ > 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

