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

Ulrich Hertlein u.hertlein at sandbox.de
Mon Sep 2 00:42:35 PDT 2019

Hi Franco,

From the png I understand that you have a Group with Geodes A and B.
The effect will *always* be applied to the entire node that it's attached to, so if you
want to have the outline only on A or B then you must attach the effect to A or B, not the
parent Group.

Hope this helps.


On 29/8/19 07:33, Franco Tang wrote:
> 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);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20190902/24f3e894/attachment.sig>

More information about the osg-users mailing list