Can you verify that it is the SHARE_DUPLICATE_STATE optimizer flag that is
causing the issue?

If so, then I believe you can setDataVariance( STATIC ) on the StateSet to
make the optimizer not share the StateSet. I gleaned this from looking at
Optimizer.cpp, Optimizer::StateVisitor::apply().

There's also a isOperationPermissableForObject() method that gets called,
and if this returns false then this is another case in which the StateSet
isn't shared. I'm not sure what this is for, but it looks like you can
associate a callback with a StateSet that determines whether an optimizer
operation is allowed or not? The setDataVariance() seems more
straightforward...

Hope this helps,

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
303 859 9466



> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Jackson, Frank L., Jr.
> Sent: Wednesday, December 13, 2006 2:52 PM
> To: osg users
> Subject: [osg-users] Trouble with new CVS optimizer
> 
> 
> 
> Problems with optimizer
>  I am creating a large field of underbrush of various types 
> using osg billboards, and with the help of the IRC OSG users 
> group I created a culling callback that changes the 
> transparency within a minimum and maximum distance so it 
> fades out before being unloaded via the LOD. This is done for 
> each grid of Billboards the state set and material is 
> recreated for each grid of billboards. Everything works fine 
> until it is optimized then optimizer blows away the state 
> sets and then viewer starts to throw memory violations when 
> the callback tries to get to the material.  
>       The problem: I cannot just do without the optimizer 
> given the size of the scene and the amount of underbrush 
> created. I could use some assistance on this ... I can 
> provide my code samples as needed.  
>   
>  Regards,
>  C.W. 
> 
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to