[osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)
vigigio at hotmail.com
Thu Jul 24 07:08:41 PDT 2008
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 = new osgUtil::RenderBin();
binList->setStateSet( _myPreCreatedStateSet );
(binList->getRenderBinList()) = binList;
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...
More information about the osg-users