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()?
 
 
Regards,
Viggo
> Date: Thu, 24 Jul 2008 12:52:06 +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,> > 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.
http://windowslivemobile.msn.com/Homepage.aspx?lang=nb-no&ocid=30032
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to