From 956edca52492b261744f474263d7222cf6ecf7ec Mon Sep 17 00:00:00 2001 From: Alexei Dobrohotov Date: Mon, 9 Aug 2021 21:17:13 +0300 Subject: [PATCH] Don't re-enable specularity w/ material controller for MW models --- components/nifosg/nifloader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index 17551e0b91..81c3d24dcc 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -845,8 +845,10 @@ namespace NifOsg const Nif::NiMaterialColorController* matctrl = static_cast(ctrl.getPtr()); if (matctrl->data.empty() && matctrl->interpolator.empty()) continue; - osg::ref_ptr osgctrl; auto targetColor = static_cast(matctrl->targetColor); + if (mVersion <= Nif::NIFFile::NIFVersion::VER_MW && targetColor == MaterialColorController::TargetColor::Specular) + continue; + osg::ref_ptr osgctrl; if (!matctrl->interpolator.empty()) osgctrl = new MaterialColorController(matctrl->interpolator.getPtr(), targetColor, baseMaterial); else // if (!matctrl->data.empty()) @@ -1967,6 +1969,7 @@ namespace NifOsg case Nif::RC_NiSpecularProperty: { // Specular property can turn specular lighting off. + // FIXME: NiMaterialColorController doesn't care about this. auto specprop = static_cast(property); specEnabled = specprop->flags & 1; break;