[osg-users] osgFX::Outline lose material color while GL_LIGHTING set OFF

Franco Tang osgforum at tevs.eu
Wed Aug 28 22:33:49 PDT 2019


robertosfield wrote:
> Hi GG,
> 
> 
> When you switch off fixed function lighting via GL_LIGHTING you change the way that OpenGL's fixed function pipeline is configured so it no longer uses the glMaterial/osg::Material values and only uses the glColor/ColorArray (osg::Geometry::setColorArray(..) values.
> 
> 
> Robert.
> 
> 


Sorry, Robert. I had found a solution.  It's a shame for me not to find it. http://forum.openscenegraph.org/viewtopic.php?t=1380&highlight=

There is an another problem. When a group has been added into osgFX::Outline, how to remove outline effect from it's specific child.


Code:

osgFX::Outline *outline = new osgFX::Outline;

osg::Group *group = new osg::Group;
osg::Geode *geode_1 = osg::Geode;
group->addChild(geode_1);
// add more osg::Geode and init drawable for this node.
// ....

// How to remove Outline effect from this node.
// I had tried to remove stencil test. But it failed.
osg::Geode *geode_no_outline = osg::Geode;
// geode_no_outline->getOrCreateStateSet()->setMode(GL_STENCIL_TEST, osg::StateAttribute::OFF);
group->addChild(geode_no_outline);
// init drawable
// ...

outline->addChild(group);


[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76621#76621



-------------- next part --------------
A non-text attachment was scrubbed...
Name: node.png
Type: image/png
Size: 8462 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20190829/bbf07d6b/attachment.png>


More information about the osg-users mailing list