[osg-users] getting userData or accumulated Uniform in nodevisitor

Robert Osfield robert.osfield at gmail.com
Tue Feb 2 04:59:37 PST 2021

On Tue, 2 Feb 2021 at 10:38, Werner Modenbach <
Werner.Modenbach at modenbach-ac.de> wrote:

> Hi Robert,

Replying to osg-users list so that others can chip in with insights or
learn from the discussion.

> I think I'm close to getting the solution.
> Unfortunately the CullStack doesn't handle any StateSets.
> I also do not really understand what a StateGraph is.
> I just guess, calling *CullVisitor->getCurrentStateGraph()->_stateSet *gives
> me the accumulated StateSet.
> Am I right?
> Or is the accumulation of StateSets somewhere in CullVisitor->getState()?
> But there is no method for just querying a uniform in State.
> Most of the classes have only push(), pop() or apply() methods. No query
> methods.

I have touched this code for years so you are probably more familiar with
it now than I.

>From the top of my head the CullVisitor doesn't directly manage individual
state components like Uniform, just the high level StateSet.  The results
of the Cull traversal are passed on to the a osgUitl::StateGraph that
remains at the StateSet levels, it's only once this StateGraph is applied
during the draw traversal does the OSG's draw traversal behind to handle
the individual components of state like models, attributes and modes, and
this is done via osg::State.

What you are wanting to do is out of the ordinary, it's not something the
OSG was specifically designed to do.  Whether your approach is really
necessary or the best approach I don't know - I'm just trying to answer
questions.  When you do go beyond what the OSG was originally envisaged to
do you'll need to accept that you'll need to dig into code and figure stuff
out, I can only help you so much.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20210202/cfb1d1bb/attachment.html>

More information about the osg-users mailing list