You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear everyone, i try to use silverlining sky in osgearth 2.10.2, osg version is 3.6.5. I load the stl model,and adjust the time ,i found the model is very white.like below picture. i try to use the other sky --skynode later, i can get the right effect. I add the material stateset on my model as like below code. I do not know where the problem came from. I am hoping for your help. Thank you for your help.
osg::ref_ptrosg::Material material = new osg::Material;
osg::Vec4 yinbaise(192.0 / 225, 192.0 / 255, 192.0 / 255, 1.0);
material->setAmbient(osg::Material::FRONT, yinbaise);
material->setDiffuse(osg::Material::FRONT, yinbaise);
material->setSpecular(osg::Material::FRONT, yinbaise);
material->setShininess(osg::Material::FRONT, 90.0);
material->setColorMode(osg::Material::AMBIENT);
flyAirport->getOrCreateStateSet()->setAttribute(material.get());
flyAirport->getOrCreateStateSet()->setMode(GL_RESCALE_NORMAL, osg::StateAttribute::ON /| osg::StateAttribute::OVERRIDE/);
flyAirport->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
flyAirport->getOrCreateStateSet()->setMode(GL_LIGHT0, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
flyAirport->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Dear everyone, i try to use silverlining sky in osgearth 2.10.2, osg version is 3.6.5. I load the stl model,and adjust the time ,i found the model is very white.like below picture. i try to use the other sky --skynode later, i can get the right effect. I add the material stateset on my model as like below code. I do not know where the problem came from. I am hoping for your help. Thank you for your help.
osg::ref_ptrosg::Material material = new osg::Material;
osg::Vec4 yinbaise(192.0 / 225, 192.0 / 255, 192.0 / 255, 1.0);
material->setAmbient(osg::Material::FRONT, yinbaise);
material->setDiffuse(osg::Material::FRONT, yinbaise);
material->setSpecular(osg::Material::FRONT, yinbaise);
material->setShininess(osg::Material::FRONT, 90.0);
material->setColorMode(osg::Material::AMBIENT);
flyAirport->getOrCreateStateSet()->setAttribute(material.get());
flyAirport->getOrCreateStateSet()->setMode(GL_RESCALE_NORMAL, osg::StateAttribute::ON /| osg::StateAttribute::OVERRIDE/);
flyAirport->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
flyAirport->getOrCreateStateSet()->setMode(GL_LIGHT0, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
flyAirport->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON);
white result by using silverlining .
right result by using skynode
Beta Was this translation helpful? Give feedback.
All reactions