Hi,
Thanks for reply. Now the code is like
virtual void define_passes()
{
osg::ref_ptr<osg::StateSet> ss = new osg::StateSet;
ss->setAttributeAndModes( new osg::ColorMask(true, true, true, true) );
osg::Depth* depth = new osg::Depth;
depth->setWriteMask( false );
ss->setAttributeAndModes( depth, osg::StateAttribute::ON );
addPass( ss.get() );
ss = new osg::StateSet;
ss->setAttributeAndModes( new osg::ColorMask(false, false,
false, false) );
depth->setWriteMask( true );
ss->setAttributeAndModes( depth, osg::StateAttribute::ON );
addPass( ss.get() );
}
However, it could not handle sel-intersection(the picture in the attached doc)
Using:
transparency->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
transparency->setAttributeAndModes(new osg::BlendFunc(GL_SRC_ALPHA
,GL_ONE_MINUS_SRC_ALPHA), osg::StateAttribute:ShockedN);
osg::Depth* depth = new osg::Depth;
depth->setWriteMask( false );
transparency->setAttributeAndModes( depth, osg::StateAttribute::ON );
_geom_solid->setStateSet(transparency);
instead of
transparency->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
transparency->setAttributeAndModes(new osg::BlendFunc(GL_SRC_ALPHA
,GL_ONE_MINUS_SRC_ALPHA), osg::StateAttribute:ShockedN);
_geom_solid->setStateSet(transparency);
self-intersection is correct. However, some transparent parts will disappear,
like the wheels of the car in the picture in the doc, the color seems to be
blended after the inner parts.
...
Thank you!
Cheers,
Tina[/img]
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50533#50533
Attachments:
http://forum.openscenegraph.org//files/test_152.pdf
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org