Don Burns wrote on Friday, August 18, 2006 6:33 PM:
> There may be another way, but what I've done in the past is to
> subclass from your base Node class (Geode in this case) and override
> the traverse function to do this:
>
> void MyGeode::traverse(osg::NodeVisitor&nv)
> {
>
> // Abort traversals by the Optimizer. The optimizer will try
> // and combine stateSets we need to keep separate.
> if (dynamic_cast<osgUtil::BaseOptimizerVisitor*>(&nv))
> return;
>
> osg::Geode::traverse( nv );
> }
>
>
> A bit ugly. A nice flag to set would be helpful.
>
> -don
>
>
> On 8/18/06, Stephan Huber wrote:
>
> Hi,
>
> I encountered a small problem with the latest version of osg
(checked
> out yesterday).
>
> There is 1 geode with 2 geometry-drawables in my scene,
describing to
> quads, which are differently textured. The optimizer merge them
into
> one geometry, which results in the loss of one of the two
textures.
> (I am doing a fade between the two quads)
>
> I tried to set the datavariances of the two geometries and of
the
> geode to dynamic but this doesn't help.
>
> For now I disabled the MERGE_GEOMETRY flag for the optimizer,
but is
> there a more finegrained control to prevent merging of this
specific
> geode?
I suspect that Optimizer::MergeGeometryVisitor should be checking
whether or not Drawables pass isOperationPermissibleForObject(), but it
doesn't look like it is doing that (from code inspection, at least). It
also doesn't look like the
isOperationPermissibleForObjectImplementation() code checks for the
presence of StateSets on the Drawables.
You definitely shouldn't have to create Geode subclasses just to avoid
this kind of merging, IMHO.
--
Bryan Thrall
FlightSafety International
[EMAIL PROTECTED]
.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/