1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-06 11:15:33 +00:00

Don't re-enable specularity w/ material controller for MW models

This commit is contained in:
Alexei Dobrohotov 2021-08-09 21:17:13 +03:00
parent 0a73771f17
commit 956edca524

View file

@ -845,8 +845,10 @@ namespace NifOsg
const Nif::NiMaterialColorController* matctrl = static_cast<const Nif::NiMaterialColorController*>(ctrl.getPtr()); const Nif::NiMaterialColorController* matctrl = static_cast<const Nif::NiMaterialColorController*>(ctrl.getPtr());
if (matctrl->data.empty() && matctrl->interpolator.empty()) if (matctrl->data.empty() && matctrl->interpolator.empty())
continue; continue;
osg::ref_ptr<MaterialColorController> osgctrl;
auto targetColor = static_cast<MaterialColorController::TargetColor>(matctrl->targetColor); auto targetColor = static_cast<MaterialColorController::TargetColor>(matctrl->targetColor);
if (mVersion <= Nif::NIFFile::NIFVersion::VER_MW && targetColor == MaterialColorController::TargetColor::Specular)
continue;
osg::ref_ptr<MaterialColorController> osgctrl;
if (!matctrl->interpolator.empty()) if (!matctrl->interpolator.empty())
osgctrl = new MaterialColorController(matctrl->interpolator.getPtr(), targetColor, baseMaterial); osgctrl = new MaterialColorController(matctrl->interpolator.getPtr(), targetColor, baseMaterial);
else // if (!matctrl->data.empty()) else // if (!matctrl->data.empty())
@ -1967,6 +1969,7 @@ namespace NifOsg
case Nif::RC_NiSpecularProperty: case Nif::RC_NiSpecularProperty:
{ {
// Specular property can turn specular lighting off. // Specular property can turn specular lighting off.
// FIXME: NiMaterialColorController doesn't care about this.
auto specprop = static_cast<const Nif::NiSpecularProperty*>(property); auto specprop = static_cast<const Nif::NiSpecularProperty*>(property);
specEnabled = specprop->flags & 1; specEnabled = specprop->flags & 1;
break; break;