[osg-users] Is it possible to know when the node-graph is 'dirty'?

Viggo Løvli vigigio at hotmail.com
Wed Jul 23 02:00:17 PDT 2008

Hi Peter,
What you say is true in most cases. The 'simplest' way to do this would be to tell my system that the node-tree need re-formatting each time we call OSG to add children. That would require two calls each time, and also requre humans to remember to implement both calls. This opens for human errors, which at least I dont want (I am lazy).
I want to make my module (the one that need to format the node-masks) independent of the rest of the system, and to ensure that the rest of the system will not need to know about my module.
I also want to be able to add 3rd party libraries to my application without re-writing them to do special calls to my module when they add nodes to the tree.
So, the conclusion I have is that I need to automatically know when I need to format the node-masks.
The osg::Group has a callback function named osg::Group::childInserted.
I can make my root-node into a sub-class og osg::Group where I implement the childInserted function. This way I will get a callback each time someone add nodes to my root-node. If a module create it's own osg::Group and add children to it dymically then I would not know anything about that.
I also saw Roberts reply and I agree that a dirty system on the node-tree would be very expensive. I knew that my question was a longshot.
I am now thinking about other solutions to achieve my goal. The goal is to render the world with 3 slave cameras. One shall render all render-bins up to bin 9. One shall render bin 10. And the 3rd shall render bin 10 and up. So bin 10 is rendered twice. This is to fix some glitches on transparent polygons that intersect each other while needing to write to the depth-buffer.
Ok, so another solution would be to force a camera to only render a certain number of bins.
I have not seen any place in the code around camera or cull-settings that you can specify a camera to stay within a limited range of render-bins, so I guess this won't be as easy either?
Do you have any suggestions on how to be able to render one bin twice in the same frame. The first and second render of the bin shall have a few render-states set differently.

Date: Wed, 23 Jul 2008 07:58:37 +0200From: osghelp at gmail.comTo: osg-users at lists.openscenegraph.orgSubject: Re: [osg-users] Is it possible to know when the node-graph is 'dirty'?

Hi Viggo,
Don't know the details of your code, but if you are adding a sub-node then you have code already that is called for adding the sub-node and
thereby you know when the scene-graph has been modified?
On Wed, Jul 23, 2008 at 7:51 AM, Viggo Løvli <vigigio at hotmail.com> wrote:

Hi, My code is currently formatting the node-masks of the whole scene-graph before we start rendering. The formatting code is only ran once.If a sub-node is added to the node-tree afterwards then I want to run my formatting code again. Is there any way to know whether or not the scene-graph has been modified? Regards,Viggo

Windows Live Hotmail på mobilen. Ha alltid e-posten din tilgjengelig._______________________________________________osg-users mailing listosg-users at lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org-- Regards,Peter Wraae Marinowww.osghelp.com - OpenSceneGraph support site 
Hold kontakten med Windows Live Messenger.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080723/6019b140/attachment-0003.htm>

More information about the osg-users mailing list