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

Viggo Løvli vigigio at hotmail.com
Thu Jul 24 07:08:41 PDT 2008

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] = new osgUtil::RenderBin();
                    binList[9]->setStateSet( _myPreCreatedStateSet );
                    (binList[9]->getRenderBinList())[9] = binList[10];

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 having two RenderBin instances in my class, and use them every other call?
But, I suspect that it may not be enough? Would I need two per cull call that is ran per frame? Say that I in the future render with 4 different cameras and cull the world 4 times. Would I then need 4*2 bin instances to use instead of calling new()?
> Date: Thu, 24 Jul 2008 12:52:06 +0100> From: robert.osfield at gmail.com> To: osg-users at 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,> > 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 to reuse a fixed StateSet on every frame rather than> creating one.> > Robert.> 
Windows Live Messenger - også på mobilen.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080724/587752e0/attachment-0003.htm>

More information about the osg-users mailing list