|
osg::ref_ptr material = new osg::Material();
material->setAmbient(osg::Material::FRONT_AND_BACK,osg::Vec4(1,1,1,1));
material->setDiffuse(osg::Material::FRONT_AND_BACK,osg::Vec4(1,1,1,1));
material->setSpecular(osg::Material::FRONT_AND_BACK,osg::Vec4(0,0,0,1));
geom->getOrCreateStateSet()->setAttributeAndModes(material.get(),osg::StateAttribute::ON);
geom->getOrCreateStateSet()->setMode(GL_LIGHTING,osg::StateAttribute::OFF);(2010-12-04 11:56:53)
如果GL_LIGHTING设为OFF那么material还有用吗,为什么不设material会导致场景有时变暗,有时正常? |
|