OSG StateSet

osg::StateSet* ss=node->getOrCreateStateSet();

1、光照

ss->setMode(GL_LIGHTING, osg::StateAttribute::OFF);

2、填充模式

ss->setAttributeAndModes(new osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::LINE), osg::StateAttribute::ON);

ss->setAttributeAndModes(new osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::FILL), osg::StateAttribute::ON);

3、线宽

osg::LineWidth* lw=new osg::LineWidth();

lw->setWidth(5);

ss->setAttributeAndModes(lw, osg::StateAttribute::ON);

4、点的尺寸

osg::Point* p = new osg::Point();

p->setSize(3);

ss->setAttribute(p);

5、透明

geo->getOrCreateStateSet()->setMode(GL_BLEND, osg::StateAttribute::ON);
geo->getOrCreateStateSet()->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);

posted @ 2013-05-17 13:17  酷熊  阅读(1639)  评论(0编辑  收藏  举报