[osg-users] setAttribute / Material issue

Robert Osfield robert.osfield at gmail.com
Thu Aug 17 13:14:30 PDT 2017

Hi Paul,

On 17 August 2017 at 15:59, Paul Bigeon <osgforum at tevs.eu> wrote:

> node_stateset->setAttribute(new osg::ref_ptr< osg::Material >(),
> osg::StateAttribute::ON);

You can remove a Material attribute by doing:


Or do I have to check for setcolorArray and setsecondaryColorArray of all
> my nodes ?

SecondaryColor is lesser used extension to the old OpenGL fixed function
pipeline, it's almost never used these days so should be safe to ignore.

The normal and color arrays are of interest.  You could write a NodeVisitor
to traverse the scene graph for all osg::Geometry and check this arrays, or
just write the subgraphs out to a .osgt file and then open them up in an
editor.  Having a look at the scene graph's .osgt file can be a really
useful step to help understand how things are put together.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170817/bb7d9929/attachment.htm>

More information about the osg-users mailing list