1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-21 00:39:58 +00:00

Handle BSShader specular flag

This commit is contained in:
Alexei Kotov 2023-07-22 17:28:05 +03:00
parent 62ef209185
commit d6e420fb48
2 changed files with 8 additions and 0 deletions

View File

@ -139,6 +139,7 @@ namespace Nif
float envMapIntensity{ 0.f };
void read(NIFStream* nif) override;
bool specular() const { return flags1 & 1; }
bool doubleSided() const { return (flags2 >> 4) & 1; }
bool treeAnim() const { return (flags2 >> 29) & 1; }
bool decal() const { return (flags1 >> 26) & 1; }

View File

@ -2472,6 +2472,12 @@ namespace NifOsg
}
break;
}
case Nif::RC_BSShaderPPLightingProperty:
{
auto shaderprop = static_cast<const Nif::BSShaderPPLightingProperty*>(property);
specEnabled = shaderprop->specular();
break;
}
case Nif::RC_BSLightingShaderProperty:
{
auto shaderprop = static_cast<const Nif::BSLightingShaderProperty*>(property);
@ -2481,6 +2487,7 @@ namespace NifOsg
mat->setShininess(osg::Material::FRONT_AND_BACK, shaderprop->mGlossiness);
emissiveMult = shaderprop->mEmissiveMult;
specStrength = shaderprop->mSpecStrength;
specEnabled = shaderprop->specular();
if (shaderprop->decal())
{
osg::StateSet* stateset = node->getOrCreateStateSet();