Would you, or anyone else, have any idea how I would go about making a custom cloner/copier? The reason is because I have found that I have something that gets added say 1000 times to our scenegraph. Each instances contains 4 groups, where only one of them needs to be cloned. The other 3 can just be shallow copied. I tried this with another model that doesn't require the 4th object being cloned and saw a significant improvement by not doing so and I would like to see the improvement here as well.
From: [email protected] [mailto:[email protected]] On Behalf Of Sebastian Messerschmidt Sent: Wednesday, April 16, 2014 10:41 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Understanding Node Clone Options Hi Cary That makes sense. And I understand it for switches and transforms. Would I need to do deep_copy_nodes if it only contained geometry under LODs? I think the nodes make sense, since it is everything forming the structure (i.e. without the geodes containing the drawables) As for the arrays, we ran some tests and determined it better to flatten transforms out and do that for positioning some objects and then just put them under a single transform to move them around as a group. It was on the order of 1000+ objects. I am going to modify that code to allow me to switch methods so we can retest it. From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Sebastian Messerschmidt Sent: Wednesday, April 16, 2014 9:43 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Understanding Node Clone Options Hi Cary, I usually use the combination DEEP_COPY_NODES | DEEP_COPY_CALLBACKS. It works in my use case, where I need to instance dynamic objects (such as cars) which need to keep their individual DoF, Switches and Animations. I intentionally left out the flatten-static transform optimizations, but It might work if you visit your models transforms before optimizing and tag them as Dynamic. As far as I remember, nodes tagged DYNAMIC wont be touched by the Optimizer. Regarding the vertices: With the options above the arrays will be shared I guess, which is exactly what I want, since I only want to duplicate the "structure" but not the geometry. If you clone the arrays each instance will have its own geometry, which might have a big impact on performance. cheers Sebastian As our simulation runs we can add and remove models and many times the same model repeatedly. We only load the physical model once and then clone it for each instance we need. Each model can contain matrix transforms, switches, LODs, and update callbacks that all need to be unique. I am trying to limit how much we are actually cloning now since we don't necessarily have all of these things in every model. For example if we have a light pole that is use 100 times, we don't even need to clone, we can just add the child directly to the scene under different matrix transforms. The problem is in understanding when I actually need to clone and what type of options I need. I know I need to use the DEEP_COPY_ARRAYS when I need the actual vertices to be different, which does happen sometimes when I add a matrix that gets flattened on to the model. However, for switches, dynamic matrixTransforms, LODS, and callbacks, when do I use the different options? So far I have only gotten everything to work for those when I do a DEEP_COPY_NODES. Do I really need this, or would some subset of other options work? I guess my main question is when are each of the various DEEP_COPY_ options needed? _______________________________________________ osg-users mailing list [email protected]<mailto:[email protected]> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected]<mailto:[email protected]> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

