forked from teamnwah/openmw-tes3coop
Merge pull request #138 from OpenMW/master
Add OpenMW commits up to 2 Feb 2017
This commit is contained in:
commit
d9f5dfe65c
2 changed files with 7 additions and 2 deletions
|
@ -80,7 +80,7 @@ RenderWidget::RenderWidget(QWidget *parent, Qt::WindowFlags f)
|
||||||
defaultMat->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,1));
|
defaultMat->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,1));
|
||||||
defaultMat->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,1));
|
defaultMat->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,1));
|
||||||
defaultMat->setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4f(0.f, 0.f, 0.f, 0.f));
|
defaultMat->setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4f(0.f, 0.f, 0.f, 0.f));
|
||||||
mView->getCamera()->getOrCreateStateSet()->getOrCreateStateSet()->setAttribute(defaultMat);
|
mView->getCamera()->getOrCreateStateSet()->setAttribute(defaultMat);
|
||||||
|
|
||||||
mView->setSceneData(mRootNode);
|
mView->setSceneData(mRootNode);
|
||||||
|
|
||||||
|
|
|
@ -1674,6 +1674,8 @@ namespace NifOsg
|
||||||
mat->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,1));
|
mat->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,1));
|
||||||
mat->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,1));
|
mat->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4f(1,1,1,1));
|
||||||
|
|
||||||
|
bool hasMatCtrl = false;
|
||||||
|
|
||||||
for (std::vector<const Nif::Property*>::const_reverse_iterator it = properties.rbegin(); it != properties.rend(); ++it)
|
for (std::vector<const Nif::Property*>::const_reverse_iterator it = properties.rbegin(); it != properties.rend(); ++it)
|
||||||
{
|
{
|
||||||
const Nif::Property* property = *it;
|
const Nif::Property* property = *it;
|
||||||
|
@ -1696,7 +1698,10 @@ namespace NifOsg
|
||||||
mat->setShininess(osg::Material::FRONT_AND_BACK, matprop->data.glossiness);
|
mat->setShininess(osg::Material::FRONT_AND_BACK, matprop->data.glossiness);
|
||||||
|
|
||||||
if (!matprop->controller.empty())
|
if (!matprop->controller.empty())
|
||||||
|
{
|
||||||
|
hasMatCtrl = true;
|
||||||
handleMaterialControllers(matprop, composite, animflags);
|
handleMaterialControllers(matprop, composite, animflags);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1769,7 +1774,7 @@ namespace NifOsg
|
||||||
mat->setColorMode(osg::Material::AMBIENT);
|
mat->setColorMode(osg::Material::AMBIENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mat->getColorMode() == osg::Material::OFF
|
if (!hasMatCtrl && mat->getColorMode() == osg::Material::OFF
|
||||||
&& mat->getDiffuse(osg::Material::FRONT_AND_BACK) == osg::Vec4f(1,1,1,1)
|
&& mat->getDiffuse(osg::Material::FRONT_AND_BACK) == osg::Vec4f(1,1,1,1)
|
||||||
&& mat->getAmbient(osg::Material::FRONT_AND_BACK) == osg::Vec4f(1,1,1,1)
|
&& mat->getAmbient(osg::Material::FRONT_AND_BACK) == osg::Vec4f(1,1,1,1)
|
||||||
&& mat->getSpecular(osg::Material::FRONT_AND_BACK) == osg::Vec4f(0.f, 0.f, 0.f, 0.f))
|
&& mat->getSpecular(osg::Material::FRONT_AND_BACK) == osg::Vec4f(0.f, 0.f, 0.f, 0.f))
|
||||||
|
|
Loading…
Reference in a new issue