1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-23 19:20:56 +00:00

Merge branch 'lessshinyskyrim' into 'master'

Handle BSShader specular flag

See merge request OpenMW/openmw!3262
This commit is contained in:
psi29a 2023-07-22 16:30:26 +00:00
commit d93e055bb1
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();