Thanks Robert! I'm updating as I type. From what we've discussed, I'm confident that this will resolve all of my problems ... well maybe not all of them ... at least the OSG related problems :)
Thanks Again, Justin -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield Sent: Friday, February 29, 2008 9:43 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Camera POST_RENDER vs. postDrawCallback ... whowins? Hi Guys, I have made a few changes to osg::Camera, RenderStage and the osghud example, which should hopefully help solve the problems you are seeing and illustrate how to use them. Added to include/osg/Camera we have: /** Set the initial draw callback for custom operations to be done before the drawing of the camera's subgraph and pre render stages.*/ void setIntialDrawCallback(DrawCallback* cb) { _preDrawCallback = cb; } /** Set the final draw callback for custom operations to be done after the drawing of the camera's subgraph and all of the post render stages has been completed.*/ void setFinalDrawCallback(DrawCallback* cb) { _finalDrawCallback = cb; } These augment the original pre/post draw callbacks, with the original functions being done as before. I've added some extra doc comment to explain the ordering of all of these so hopefully this will make sense. Also added is a new operator()(RenderInfo&). /** Draw callback for custom operations.*/ struct DrawCallback : virtual public Object { DrawCallback() {} DrawCallback(const DrawCallback&,const CopyOp&) {} META_Object(osg,DrawCallback) virtual void operator () (osg::RenderInfo& renderInfo) const; virtual void operator () (const osg::Camera& /*camera*/) const {} }; The RenderInfo version is the main one now, this calls the Camera version for backwards compatibility. I also found a bug in RenderInfo::popCamera() so this is now fixed. Finally I've added a callback and event handler to the osghud example to test out the post and final draw callbacks. If you press 'p' you'll get the post draw captured image written to PostDrawCallback.png and press 'f' to get the final draw image written to FinalDrawCallack.png. For the purpose of snapshots you'll generally want to use the FinalDrawCallback. An svn update will get these chagnes. Robert. Robert. _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org