|
在设置材料属性时,启用颜色跟踪,代码如下:
osg::StateSet* state = mt->getOrCreateStateSet();
osg::ref_ptr<osg::Material> mat = new osg::Material;
mat->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE );
state->setAttribute( mat.get() );
但是会出现如下错误:
Error: Setting mode 'GL_COLOR_MATERIAL' via osg::StateSet::setMode(mode,value) ignored.
The mode 'GL_COLOR_MATERIAL' is set by the osg::Material StateAttribute.
Setting this mode would confuse osg's State tracking.
这怎么解决呢? |
|