Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)

2008-07-25 Thread Viggo Løvli
Hi Robert, My current code instances a new one each cull traverse. I wonder if that means I get a sizeof(osgUtil::RenderBin) memory leak each cull-traverse? Anyway, I am going to try to multi-buffer it. I should be able to count the number of cull-traverse calls I get for each update

Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)

2008-07-25 Thread Robert Osfield
Hi Viggo, On Fri, Jul 25, 2008 at 7:22 AM, Viggo Løvli [EMAIL PROTECTED] wrote: Hi Robert, My current code instances a new one each cull traverse. I wonder if that means I get a sizeof(osgUtil::RenderBin) memory leak each cull-traverse? The rendering backend uses ref_ptr's so there shouldn't

Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)

2008-07-25 Thread Viggo Løvli
Hi Robert, Hi Viggo, The rendering backend uses ref_ptr's so there shouldn't be any leak, assigning the new RenderBin will lead to the previous one being deleted. Yep I figured out that one :-) Rather than second guess what will be need might I suggest you maintain a recycling list of

Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)

2008-07-25 Thread Viggo Løvli
Hi Robert, I have a very strange bug. The code I have written to render one bin twice works fine in the project code-base that I am working on. I took the class and integrated into the OSGForest example, and there it does not work as expected. In the OSGForest example:- The bin is rendered two

Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)

2008-07-25 Thread Viggo Løvli
Hi Robert, Completely understandable :-) Regards, Viggo Date: Fri, 25 Jul 2008 14:00:09 +0100 From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?) Hi Viggo, I

Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)

2008-07-24 Thread Viggo Løvli
Hi Robert :-D Thanx a lot for pointing in the right direction!!! I can now enforce render-bin 10 to be rendered twice each frame with the needed stateset changes. No node-mask stuff is needed. This is a completely stand-alone fix :-) This is what I did: Camera is set up with a callback:

Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)

2008-07-24 Thread Robert Osfield
Hi Viggo, I'd do this trick using a CullCallback on the topmost node of sub graph that you won't to repeat rather than a pre draw callback. The CullVisitor keeps track of the current RenderStage. Robert. On Thu, Jul 24, 2008 at 10:53 AM, Viggo Løvli [EMAIL PROTECTED] wrote: Hi Robert :-D

Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)

2008-07-24 Thread Viggo Løvli
Hi Robert, I followed your advice added the code into the traverse function of my root node. Much of the code could now be removed, and I got rid of the 0..1 loop-hack that I had to do earlier. I think the new code looks very good. Do you see anything you would do differently? The new

Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)

2008-07-24 Thread Robert Osfield
Hi Viggo, You could possible experiment with reuse the bin rather than cloning it. Inserting a two bins for bin 9 and 10, then have the original transparent bin nested within them. I can't recall the exact details but I think I've tried a trick like this in the past. This would also allow you

Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)

2008-07-24 Thread Viggo Løvli
Hi Robert, I have changed the code a bit. Now I create my statset (_myPreCreatedStateSet) at class construction. I no longer clone bin 10. I now only do this inside the inner check: if( binList.find(10) != binList.end() ) { binList[9] =

Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)

2008-07-24 Thread Robert Osfield
On Thu, Jul 24, 2008 at 3:08 PM, Viggo Løvli [EMAIL PROTECTED] wrote: The only thing that annoy me now is the call to new(). Creating one bin as a member variable in my class and using it instead of the call to new cause the system to crash. Double buffering I guess. So maybe I can fix this by