Skip to content

Commit

Permalink
Set ambient color of material the same as diffuse (#10358)
Browse files Browse the repository at this point in the history
  • Loading branch information
anotheruserofgithub committed Mar 21, 2023
1 parent 7968170 commit b15dde7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions OMEdit/OMEditLIB/Animation/Visualization.cpp
Expand Up @@ -1634,6 +1634,7 @@ void UpdateVisitor::changeColor(osg::StateSet* ss, const QColor color)
{
osg::ref_ptr<osg::Material> material = dynamic_cast<osg::Material*>(ss->getAttribute(osg::StateAttribute::MATERIAL));
if (!material.valid()) material = new osg::Material();
material->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4f(color.redF(), color.greenF(), color.blueF(), color.alphaF()));
material->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4f(color.redF(), color.greenF(), color.blueF(), color.alphaF()));
ss->setAttribute(material.get());
}
Expand Down

0 comments on commit b15dde7

Please sign in to comment.