mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-28 16:39:43 +00:00
Handle BSShader specular flag
This commit is contained in:
parent
62ef209185
commit
d6e420fb48
2 changed files with 8 additions and 0 deletions
|
@ -139,6 +139,7 @@ namespace Nif
|
||||||
float envMapIntensity{ 0.f };
|
float envMapIntensity{ 0.f };
|
||||||
void read(NIFStream* nif) override;
|
void read(NIFStream* nif) override;
|
||||||
|
|
||||||
|
bool specular() const { return flags1 & 1; }
|
||||||
bool doubleSided() const { return (flags2 >> 4) & 1; }
|
bool doubleSided() const { return (flags2 >> 4) & 1; }
|
||||||
bool treeAnim() const { return (flags2 >> 29) & 1; }
|
bool treeAnim() const { return (flags2 >> 29) & 1; }
|
||||||
bool decal() const { return (flags1 >> 26) & 1; }
|
bool decal() const { return (flags1 >> 26) & 1; }
|
||||||
|
|
|
@ -2472,6 +2472,12 @@ namespace NifOsg
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case Nif::RC_BSShaderPPLightingProperty:
|
||||||
|
{
|
||||||
|
auto shaderprop = static_cast<const Nif::BSShaderPPLightingProperty*>(property);
|
||||||
|
specEnabled = shaderprop->specular();
|
||||||
|
break;
|
||||||
|
}
|
||||||
case Nif::RC_BSLightingShaderProperty:
|
case Nif::RC_BSLightingShaderProperty:
|
||||||
{
|
{
|
||||||
auto shaderprop = static_cast<const Nif::BSLightingShaderProperty*>(property);
|
auto shaderprop = static_cast<const Nif::BSLightingShaderProperty*>(property);
|
||||||
|
@ -2481,6 +2487,7 @@ namespace NifOsg
|
||||||
mat->setShininess(osg::Material::FRONT_AND_BACK, shaderprop->mGlossiness);
|
mat->setShininess(osg::Material::FRONT_AND_BACK, shaderprop->mGlossiness);
|
||||||
emissiveMult = shaderprop->mEmissiveMult;
|
emissiveMult = shaderprop->mEmissiveMult;
|
||||||
specStrength = shaderprop->mSpecStrength;
|
specStrength = shaderprop->mSpecStrength;
|
||||||
|
specEnabled = shaderprop->specular();
|
||||||
if (shaderprop->decal())
|
if (shaderprop->decal())
|
||||||
{
|
{
|
||||||
osg::StateSet* stateset = node->getOrCreateStateSet();
|
osg::StateSet* stateset = node->getOrCreateStateSet();
|
||||||
|
|
Loading…
Reference in a new issue